...
CustLedgEntryInserted2 := CustLedgEntryInserted;
IF CheckCarteraPostDtldCustLE(GenJnlLine,DtldCustLedgEntry2,ReceivableAccAmtLCY,ReceivableAccAmtAddCurr,FALSE) THEN BEGIN
IF (TotalAmountLCY <> 0) OR (TotalAmountAddCurr <> 0) OR (GenJnlLine."Applies-to ID" <> '') THEN BEGIN
InitGLEntry(
AccNo, ReceivableAccAmtLCY, ReceivableAccAmtAddCurr,
TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
GLEntry."Entry No." := SaveEntryNo;
NextEntryNo := NextEntryNo - 1;
NextEntryNo2 := NextEntryNo;
SavedEntryUsed := TRUE;
InsertGLEntry(TRUE);
END;
...
...
CustLedgEntryInserted2 := CustLedgEntryInserted;
IF CheckCarteraPostDtldCustLE(GenJnlLine,DtldCustLedgEntry2,ReceivableAccAmtLCY,ReceivableAccAmtAddCurr,FALSE) THEN BEGIN
IF (TotalAmountLCY <> 0) OR (TotalAmountAddCurr <> 0) OR (GenJnlLine."Applies-to ID" <> '') THEN BEGIN
InitGLEntry(
AccNo, ReceivableAccAmtLCY, ReceivableAccAmtAddCurr,
TRUE,TRUE);
GLEntry."Bal. Account Type" := GenJnlLine."Bal. Account Type";
GLEntry."Bal. Account No." := GenJnlLine."Bal. Account No.";
// Add the following line.
IF CustLedgEntryInserted OR FindBill THEN BEGIN
// End of the added line.
GLEntry."Entry No." := SaveEntryNo;
NextEntryNo := NextEntryNo - 1;
NextEntryNo2 := NextEntryNo;
// Add the following line.
END;
// End of the added line.
SavedEntryUsed := TRUE;
InsertGLEntry(TRUE);
END;
...
...
IF CustLedgEntryInserted AND ((TotalAmountLCY = 0) OR
((TotalAmountAddCurr = 0) AND (GLSetup."Additional Reporting Currency" <> '')))
THEN BEGIN
HandlDtlAddjustment(DebitAddjustment,DebitAddjustmentAddCurr,CreditAddjustment,CreditAddjustmentAddCurr,
TotalAmountLCY,TotalAmountAddCurr,CustPostingGr."Receivables Account");
GLEntry."Entry No." := SaveEntryNo;
NextEntryNo := NextEntryNo - 1;
NextEntryNo2 := NextEntryNo;
SavedEntryUsed := TRUE;
InsertGLEntry(TRUE);
END;
...
...
IF CustLedgEntryInserted AND ((TotalAmountLCY = 0) OR
((TotalAmountAddCurr = 0) AND (GLSetup."Additional Reporting Currency" <> '')))
THEN BEGIN
HandlDtlAddjustment(DebitAddjustment,DebitAddjustmentAddCurr,CreditAddjustment,CreditAddjustmentAddCurr,
TotalAmountLCY,TotalAmountAddCurr,CustPostingGr."Receivables Account");
// Add the following line.
IF CustLedgEntryInserted OR FindBill THEN BEGIN
// End of the added line.
GLEntry."Entry No." := SaveEntryNo;
NextEntryNo := NextEntryNo - 1;
NextEntryNo2 := NextEntryNo;
// Add the following line.
END;
// End of the added line.
SavedEntryUsed := TRUE;
InsertGLEntry(TRUE);
END;
...