...
AdjCredit := 0;
AdjDebit := 0;
BankAccNo := BankAccNo + 1;
...
...
// Add the following line.
TempEntryNoAmountBuf.DELETEALL;
AdjCredit := 0;
AdjDebit := 0;
BankAccNo := BankAccNo + 1;
...
...
IF AdjAmount > 0 THEN
GainOrLoss := Text26501
ELSE
GainOrLoss := Text26502;
SetAdjDebitCredit(Amount,AdjCredit,AdjDebit);
END;
// Delete the following line.
END;
...
...
IF AdjAmount > 0 THEN
GainOrLoss := Text26501
ELSE
GainOrLoss := Text26502;
SetAdjDebitCredit(Amount,AdjCredit,AdjDebit);
END;
// Add the following lines.
IF (TempEntryNoAmountBuf.Amount <> 0) AND (NOT TestMode) THEN BEGIN
TempJnlLineDim.RESET;
TempJnlLineDim.DELETEALL;
TempDimBuf.RESET;
TempDimBuf.DELETEALL;
DimBufMgt.GetDimensions(TempEntryNoAmountBuf."Entry No.",TempDimBuf);
DimMgt.CopyDimBufToJnlLineDim(
TempDimBuf,TempJnlLineDim,GenJnlLine."Journal Template Name",
GenJnlLine."Journal Batch Name",GenJnlLine."Line No.");
IF TempEntryNoAmountBuf.Amount > 0 THEN BEGIN
Currency.TESTFIELD("Realized Gains Acc.");
PostAdjmt(
Currency."Realized Gains Acc.",-TempEntryNoAmountBuf.Amount,TempEntryNoAmountBuf.Amount2,
"Currency Code",TempJnlLineDim,PostingDate,'');
END ELSE BEGIN
Currency.TESTFIELD("Realized Losses Acc.");
PostAdjmt(
Currency."Realized Losses Acc.",-TempEntryNoAmountBuf.Amount,TempEntryNoAmountBuf.Amount2,
"Currency Code",TempJnlLineDim,PostingDate,'');
END;
END;
END;
// End of the added lines.
...