Overview
Portion yield configuration (Porciones) tells the system how many student servings you get from 1 kilogram, 1 liter, or 1 unit of each product. This is essential for automatic inventory calculations in daily operations.Required Role: Director or Madre ProcesadoraSupervisors can view portion configurations but cannot create or modify them.
Why Portion Yields Matter
When you register a daily operation, the system needs to know:- You provide: 120 students ate lunch today, we cooked Arroz
- System needs to know: How much Arroz to deduct from inventory?
- Portion yield provides the answer: If 1 kg Arroz = 12 portions, then 120 students = 10 kg
Calculation Formula
- Product: Arroz
- Portion yield: 12 portions per kg
- Attendance: 120 students
- Calculation: 120 ÷ 12 = 10 kg of Arroz
Configuring a Portion Yield
Select the product
Choose a product from the dropdown. Only products that don’t already have a portion yield will appear in the list.The unit of measure will auto-populate based on the product’s configured unit (kg, lt, or unidades).
Enter the portion yield
Enter how many student servings you get from 1 unit of this product.Examples:
- Arroz (rice): 1 kg → 12 portions → Enter
12 - Leche en polvo (powdered milk): 1 kg → 40 portions → Enter
40 - Pollo (chicken): 1 kg → 4 portions → Enter
4 - Caraotas (beans): 1 kg → 10 portions → Enter
10 - Aceite (oil): 1 lt → 50 portions → Enter
50
Add notes (optional)
Use the notes field to document:
- How the yield was calculated
- Special preparation instructions
- Source of the yield estimate
Example from Code (Porciones.jsx:91-128)
Viewing Configured Portions
The Porciones page displays a table with:| Column | Description |
|---|---|
| Rubro | Product name |
| Rendimiento (porciones) | How many servings per unit (e.g., “12 porciones / kg”) |
| Ejemplo de cálculo | Real-world calculation using recent attendance data |
| Notas | Additional notes about the yield |
| Acciones | Edit/Delete buttons (Director/Madre Procesadora only) |
Example Calculation Column
If the system has a recent attendance record, it shows:Code for Example Calculation (Porciones.jsx:302-307)
Updating a Portion Yield
Modify the yield
Update the “Rendimiento (porciones)” field with the new value.You cannot change the product itself - only the yield number and notes.
Updating a portion yield only affects future operations. Past operations retain the yield that was used at the time they were created.
Deleting a Portion Configuration
Required Role: Director or Madre Procesadora
Database Structure (supabase_schema.sql:116-123)
- Each product can have only one portion yield (UNIQUE constraint)
- Yield must be a positive number
- Unit of measure must match product’s unit
How Portion Yields Are Used
When you create a daily operation, the system:- Retrieves the yield from
receta_porciontable - Calculates quantity needed = attendance ÷ yield
- Validates sufficient stock before allowing submission
- Consumes FIFO batches for the calculated quantity
Yield Retrieval (supabase_schema.sql:608-615)
Quantity Calculation (supabase_schema.sql:617-618)
Example Portion Yields (supabase_schema.sql:882-888)
The system includes sample portion yields for common products:Determining Portion Yields
Method 1: Weight-based calculation
Method 1: Weight-based calculation
Measure the weight per serving, then calculate:Formula: Yield = 1000g ÷ grams per servingExample:
- Rice serving: 100g per student
- Calculation: 1000g ÷ 100g = 10 portions per kg
- Enter:
10
Method 2: Volume-based calculation
Method 2: Volume-based calculation
For liquids, measure the volume per serving:Formula: Yield = 1000ml ÷ ml per servingExample:
- Milk serving: 200ml per student
- Calculation: 1000ml ÷ 200ml = 5 portions per liter
- Enter:
5
Method 3: Historical observation
Method 3: Historical observation
Cook a meal and record:
- Amount used (e.g., 20 kg of rice)
- Students served (e.g., 240 students)
- Calculation: 240 ÷ 20 = 12 portions per kg
- Enter:
12
Method 4: Nutritional guidelines
Method 4: Nutritional guidelines
Use official dietary guidelines for school meals:
- Check government recommendations
- Ask a nutritionist
- Reference PAE (Programa de Alimentación Escolar) standards
Best Practices
Configure yields before the school year starts
Configure yields before the school year starts
Set up all portion yields during planning/setup time, not during busy meal service periods.
Document your calculations
Document your calculations
Use the “Notas” field to record:
- How you determined the yield
- Date it was calculated
- Any special considerations
Review yields periodically
Review yields periodically
Every few months, verify that yields still match actual usage:
- Compare inventory consumption to meals served
- Adjust yields if consistently over/under-consuming
- Update notes with the date of review
Be conservative with new products
Be conservative with new products
When adding a new product, start with a conservative (lower) yield estimate. It’s better to have leftover stock than run out mid-service.
Use consistent units
Use consistent units
Make sure the unit_measure in the portion configuration matches the product’s unit:
- Rice product: kg → portion yield should be per kg
- Oil product: lt → portion yield should be per liter
Common Portion Yield Ranges
Typical yields for common products:| Product Type | Typical Yield | Notes |
|---|---|---|
| Grains (rice, pasta) | 8-12 portions/kg | Depends on age group and serving size |
| Proteins (meat, chicken) | 3-5 portions/kg | Raw weight before cooking |
| Legumes (beans, lentils) | 8-12 portions/kg | Dry weight |
| Powdered milk | 30-50 portions/kg | Depends on dilution ratio |
| Oil | 40-60 portions/lt | Small amounts used per serving |
| Vegetables | 4-8 portions/kg | Varies by type and preparation |
Troubleshooting
Product doesn't appear in dropdown
Product doesn't appear in dropdown
Cause: The product already has a portion yield configured.Solution: Each product can only have one yield. If you need to change it, edit the existing yield instead of creating a new one.
Can't use product in daily operations
Can't use product in daily operations
Cause: The product doesn’t have a configured portion yield.Solution: Go to Porciones and configure the yield before trying to use it in Registro Diario.
Calculations seem wrong
Calculations seem wrong
Cause: Portion yield may be set incorrectly.Solution:
- Check the “Ejemplo de cálculo” column
- Verify it makes sense for your serving sizes
- Edit the yield if needed
- Document the change in the notes field
No example calculation showing
No example calculation showing
Cause: No recent attendance data in the system.Solution: This is normal if you haven’t created any daily operations yet. The example will appear once you register your first operation.
Related Resources
Daily Operations
How portion yields are used to calculate inventory consumption
Managing Products
Create products before configuring their yields
FIFO System
How consumed quantities are deducted from batches