A Part Number has total on-hand qty that needs to subtract each Sales Order demand qty for that part number. So if part 123 has 1000 on-hand and there is a demand 1,then 2 and 5. The remaining on-hand needs to show the resultant Qty On Hand.
Qty On Hand 1000 minus Demand qty 1 = 999 (resultant qty).
Qty On Hand 999 minus Demand qty 2 = 997 (resultant qty).
Qty On Hand 997 minus Demand qty 5 = 992 (resultant qty).
The formulas that I have tried are:
GroupHeader Section:
@Initialize
whileprintingrecords;
NumberVar onhand := 0;
GroupHeader Section:
whilereadingrecords;
numbervar onhand := {Command.TotalQTY}
Details:
whilereadingrecords;
numbervar onhand := onhand - @demandqty
Qty On Hand 1000 minus Demand qty 1 = 999 (resultant qty).
Qty On Hand 999 minus Demand qty 2 = 997 (resultant qty).
Qty On Hand 997 minus Demand qty 5 = 992 (resultant qty).
The formulas that I have tried are:
GroupHeader Section:
@Initialize
whileprintingrecords;
NumberVar onhand := 0;
GroupHeader Section:
whilereadingrecords;
numbervar onhand := {Command.TotalQTY}
Details:
whilereadingrecords;
numbervar onhand := onhand - @demandqty