...
REPEAT
IF NOT (Adjustment OR ExpCostIsCompletelyInvoiced(OutbndItemLedgEntry,OutbndValueEntry)) AND
// Delete the following line.
NOT (OutbndItemLedgEntry."Entry Type" = OutbndItemLedgEntry."Entry Type"::Output) AND
// End of the line.
Inventoriable
THEN BEGIN
SETRANGE("Document No.","Document No.");
SETRANGE("Document Line No.","Document Line No.");
CalcOutbndDocOldCost(
// Delete the following line.
OldCostElementBuf,OutbndValueEntry,OutbndItemLedgEntry.IsExactCostReversingPurchase);
// End of the line.
CalcCostPerUnit(OutbndValueEntry,OutbndCostElementBuf,OutbndItemLedgEntry.Quantity);
...
...
REPEAT
IF NOT (Adjustment OR ExpCostIsCompletelyInvoiced(OutbndItemLedgEntry,OutbndValueEntry)) AND
Inventoriable
THEN BEGIN
SETRANGE("Document No.","Document No.");
SETRANGE("Document Line No.","Document Line No.");
CalcOutbndDocOldCost(
// Add the following lines.
OldCostElementBuf,OutbndValueEntry,
OutbndItemLedgEntry.IsExactCostReversingPurchase OR OutbndItemLedgEntry.IsExactCostReversingOutput);
// End of the lines.
CalcCostPerUnit(OutbndValueEntry,OutbndCostElementBuf,OutbndItemLedgEntry.Quantity);
...