...
IF SalesHeader."Document Type" IN
[SalesHeader."Document Type"::"Return Order",SalesHeader."Document Type"::"Credit Memo"]
THEN
TempICGenJnlLine.Amount :=
// Delete the following line.
-ROUND(
CurrExchRate.ExchangeAmtFCYToLCY(
SalesHeader."Posting Date",SalesLine."Currency Code",
SalesLine.Amount,SalesHeader."Currency Factor"))
ELSE
TempICGenJnlLine.Amount :=
// Delete the following line.
ROUND(
CurrExchRate.ExchangeAmtFCYToLCY(
SalesHeader."Posting Date",SalesLine."Currency Code",
SalesLine.Amount,SalesHeader."Currency Factor"));
END ELSE BEGIN
Currency.InitRoundingPrecision;
TempICGenJnlLine."Currency Code" := SalesHeader."Currency Code";
TempICGenJnlLine."Currency Factor" := SalesHeader."Currency Factor";
IF SalesHeader."Document Type" IN [SalesHeader."Document Type"::"Return Order",SalesHeader."Document Type"::"Credit Memo"] THEN
// Delete the following line.
TempICGenJnlLine.Amount := -SalesLine.Amount
ELSE
// Delete the following line.
TempICGenJnlLine.Amount := SalesLine.Amount;
...
...
IF SalesHeader."Document Type" IN
[SalesHeader."Document Type"::"Return Order",SalesHeader."Document Type"::"Credit Memo"]
THEN
TempICGenJnlLine.Amount :=
// Add the following line.
ROUND(
CurrExchRate.ExchangeAmtFCYToLCY(
SalesHeader."Posting Date",SalesLine."Currency Code",
SalesLine.Amount,SalesHeader."Currency Factor"))
ELSE
TempICGenJnlLine.Amount :=
// Add the following line.
-ROUND(
CurrExchRate.ExchangeAmtFCYToLCY(
SalesHeader."Posting Date",SalesLine."Currency Code",
SalesLine.Amount,SalesHeader."Currency Factor"));
END ELSE BEGIN
Currency.InitRoundingPrecision;
TempICGenJnlLine."Currency Code" := SalesHeader."Currency Code";
TempICGenJnlLine."Currency Factor" := SalesHeader."Currency Factor";
IF SalesHeader."Document Type" IN [SalesHeader."Document Type"::"Return Order",SalesHeader."Document Type"::"Credit Memo"] THEN
// Add the following line.
TempICGenJnlLine.Amount := SalesLine.Amount
ELSE
// Add the following line.
TempICGenJnlLine.Amount := -SalesLine.Amount;
...