...
// Delete the following line.
LOCAL PROCEDURE CalcExpectedCost@60(ItemLedgEntryNo@1003 : Integer;InvoicedQty@1006 : Decimal;Quantity@1005 : Decimal;VAR ExpectedCost@1001 : Decimal;VAR ExpectedCostACY@1002 : Decimal;VAR ExpectedSalesAmt@1007 : Decimal;VAR ExpectedPurchAmt@1008 : Decimal;CalcReminder@1004 : Boolean);
VAR
...
...
// Add the following line.
LOCAL PROCEDURE CalcExpectedCost@60(VAR InvdValueEntry@1009 : Record 5802;ItemLedgEntryNo@1003 : Integer;InvoicedQty@1006 : Decimal;Quantity@1005 : Decimal;VAR ExpectedCost@1001 : Decimal;VAR ExpectedCostACY@1002 : Decimal;VAR ExpectedSalesAmt@1007 : Decimal;VAR ExpectedPurchAmt@1008 : Decimal;CalcReminder@1004 : Boolean);
VAR
...
...
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;
END;
...
...
END
// 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 of the 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;
END;
...