...
WHEN a production journal is posted:
For each Item Journal Line WHERE Item_Backflush after Work Order = FALSE
Populate the following in the Waste Object:
Work Order
Item Journal Line
Item
Base UOM
Calculate the following:
Work Line_Expected Quantity - Item Journal Line_Quantity
Save that value in Waste-Waste Quantity
(Work Line_Expected Quantity - Item Journal Line_Quantity) / Work Line_Expected Quantity
Save that value in the Waste _Percentage Waste field
...