...
// Delete the following lines.
END ELSE BEGIN
REPEAT
IF "Expected Cost" THEN BEGIN
ExpectedCost := ExpectedCost + "Cost Amount (Expected)";
ExpectedCostACY := ExpectedCostACY + "Cost Amount (Expected) (ACY)";
IF NOT CalledFromAdjustment THEN BEGIN
ExpectedSalesAmt := ExpectedSalesAmt + "Sales Amount (Expected)";
ExpectedPurchAmt := ExpectedPurchAmt + "Purchase Amount (Expected)";
END;
END;
UNTIL NEXT = 0;
ExpectedCost :=
CalcExpCostToBalance(ExpectedCost,InvoicedQty,Quantity,GLSetup."Amount Rounding Precision");
ExpectedCostACY :=
CalcExpCostToBalance(ExpectedCostACY,InvoicedQty,Quantity,Currency."Amount Rounding Precision");
IF NOT CalledFromAdjustment THEN BEGIN
ExpectedSalesAmt :=
CalcExpCostToBalance(ExpectedSalesAmt,InvoicedQty,Quantity,GLSetup."Amount Rounding Precision");
ExpectedPurchAmt :=
CalcExpCostToBalance(ExpectedPurchAmt,InvoicedQty,Quantity,GLSetup."Amount Rounding Precision");
END;
END;
// End of the deleted lines.
...
...
// Add the following lines.
END ELSE
IF InvdValueEntry.Adjustment AND
(InvdValueEntry."Entry Type" = InvdValueEntry."Entry Type"::"Direct Cost")
THEN BEGIN
ExpectedCost := -InvdValueEntry."Cost Amount (Actual)";
ExpectedCostACY := -InvdValueEntry."Cost Amount (Actual) (ACY)";
IF NOT CalledFromAdjustment THEN BEGIN
ExpectedSalesAmt := -InvdValueEntry."Sales Amount (Actual)";
ExpectedPurchAmt := -InvdValueEntry."Purchase Amount (Actual)";
END
END ELSE BEGIN
REPEAT
IF "Expected Cost" THEN BEGIN
ExpectedCost := ExpectedCost + "Cost Amount (Expected)";
ExpectedCostACY := ExpectedCostACY + "Cost Amount (Expected) (ACY)";
IF NOT CalledFromAdjustment THEN BEGIN
ExpectedSalesAmt := ExpectedSalesAmt + "Sales Amount (Expected)";
ExpectedPurchAmt := ExpectedPurchAmt + "Purchase Amount (Expected)";
END;
END;
UNTIL NEXT = 0;
ExpectedCost :=
CalcExpCostToBalance(ExpectedCost,InvoicedQty,Quantity,GLSetup."Amount Rounding Precision");
ExpectedCostACY :=
CalcExpCostToBalance(ExpectedCostACY,InvoicedQty,Quantity,Currency."Amount Rounding Precision");
IF NOT CalledFromAdjustment THEN BEGIN
ExpectedSalesAmt :=
CalcExpCostToBalance(ExpectedSalesAmt,InvoicedQty,Quantity,GLSetup."Amount Rounding Precision");
ExpectedPurchAmt :=
CalcExpCostToBalance(ExpectedPurchAmt,InvoicedQty,Quantity,GLSetup."Amount Rounding Precision");
END;
END;
// End of the added lines.
...