When viewing the Aggregate Measures Report the following logic is used.
The date range is used to filter material issued or returned transaction date and labor cost detail record's date.
The Status is only used to filter the Job status, there is no relation with date range.
This Report is used to show the measure's Actual material Cost from material management records, measure's Actual Labor Cost from labor cost detail records, and Estimate material Cost by Agency Measure Unit Cost * Measure Qty, Estimate Labor Cost by Agency Measure Unit labor Cost * Measure Qty, and their variance.
Estimate labor hour is equal to Agency Measure Unit Labor Cost multiplied by Measure Qty divided by 35
Following is how the report data is generated:
1. Get all material management records with type: issue to work order or return from work order and transaction date is in Date Range.
2. Get all labor cost detail records with dates in Date Range.
3. For step 1, step 2 records, find their corresponding measure install records.
4. If there are Status being selected, then filter measure install records' Job by the selected job status.
5. For the measure install records, find its Agency Measure Unit Cost on Agency Measure screen, times its Qty to get Plan material cost.
6. For the measure install records, find its Agency Unit Labor Cost on Agency Measure screen, times its Qty to get Plan labor Cost.
7. For the measure install records, use the Plan Labor Cost dividing 35 (35 is standard hourly rate) to get Plan Labor Hour.
8. For the measure install records, get sum of material management records' to get its Actual material Cost
9. For the measure install records, get sum of labor cost detail records' to get its Actual Labor Cost.
10. For the Variance, use Plan value - Actual value.
11. After we got above values for each measure install record, we need to summarize the result by Measure Name and Measure's Vendor.
Measure's Vendor is its work order's vendor.