...
LOCAL PROCEDURE PostDtldCustLedgEntries@46(GenJnlLine2@1000 : Record 81;VAR DtldCVLedgEntryBuf@1001 : Record 383;CustPostingGr@1002 : Record 92;GLSetup@1003 : Record 98;NextTransactionNo@1004 : Integer;CustLedgEntryInserted@1012 : Boolean);
VAR
DtldCustLedgEntry@1005 : Record 379;
Currency@1007 : Record 4;
GenPostingSetup@1008 : Record 252;
TotalAmountLCY@1009 : Decimal;
TotalAmountAddCurr@1010 : Decimal;
PaymentDiscAcc@1011 : Code[20];
DtldCustLedgEntryNoOffset@1006 : Integer;
PaymentTolAcc@1013 : Code[20];
...
...
LOCAL PROCEDURE PostDtldCustLedgEntries@46(GenJnlLine2@1000 : Record 81;VAR DtldCVLedgEntryBuf@1001 : Record 383;CustPostingGr@1002 : Record 92;GLSetup@1003 : Record 98;NextTransactionNo@1004 : Integer;CustLedgEntryInserted@1012 : Boolean);
VAR
DtldCustLedgEntry@1005 : Record 379;
Currency@1007 : Record 4;
GenPostingSetup@1008 : Record 252;
// Add the following line.
DtldCustLedgEntry3@1100044 : Record 379;
// End of the added line.
TotalAmountLCY@1009 : Decimal;
TotalAmountAddCurr@1010 : Decimal;
PaymentDiscAcc@1011 : Code[20];
DtldCustLedgEntryNoOffset@1006 : Integer;
PaymentTolAcc@1013 : Code[20];
...
...
ReceivableAccAmtLCY@1100001 : Decimal;
ReceivableAccAmtAddCurr@1100000 : Decimal;
DtldCustLedgEntry2@1100003 : TEMPORARY Record 379;
ExistDtldCVLedgEntryBuf@1000003 : Boolean;
FindBill@1100004 : Boolean;
BEGIN
TotalAmountLCY := 0;
TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
...
...
ReceivableAccAmtLCY@1100001 : Decimal;
ReceivableAccAmtAddCurr@1100000 : Decimal;
DtldCustLedgEntry2@1100003 : TEMPORARY Record 379;
ExistDtldCVLedgEntryBuf@1000003 : Boolean;
FindBill@1100004 : Boolean;
// Add the following line.
EntryUnapplied@1100051 : Boolean;
// End of the added line.
BEGIN
TotalAmountLCY := 0;
TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
...
...
TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
NegativeLCYAppAmt := 0;
NegativeACYAppAmt := 0;
IF GenJnlLine2."Account Type" = GenJnlLine2."Account Type"::Customer THEN BEGIN
IF DtldCustLedgEntry.FINDLAST THEN
DtldCustLedgEntryNoOffset := DtldCustLedgEntry."Entry No."
ELSE
...
...
TotalAmountAddCurr := 0;
PositiveLCYAppAmt := 0;
PositiveACYAppAmt := 0;
NegativeLCYAppAmt := 0;
NegativeACYAppAmt := 0;
// Add the following line.
EntryUnapplied := FALSE;
// End of the added line.
IF GenJnlLine2."Account Type" = GenJnlLine2."Account Type"::Customer THEN BEGIN
IF DtldCustLedgEntry.FINDLAST THEN
DtldCustLedgEntryNoOffset := DtldCustLedgEntry."Entry No."
ELSE
...
...
END;
InsertGLEntry(TRUE);
GenJnlLine."Posting Date" := OriginalPostingDate;
END;
// Delete the following line.
PostReceivableDocs(GenJnlLine);
// End of the deleted line.
IF NOT GLEntryTmp.FINDFIRST AND ExistDtldCVLedgEntryBuf THEN BEGIN
InitGLEntry(CustPostingGr."Receivables Account",PositiveLCYAppAmt,PositiveACYAppAmt,FALSE,TRUE);
InsertGLEntry(FALSE);
InitGLEntry(CustPostingGr."Receivables Account",NegativeLCYAppAmt,NegativeACYAppAmt,FALSE,TRUE);
...
...
END;
InsertGLEntry(TRUE);
GenJnlLine."Posting Date" := OriginalPostingDate;
END;
// Add the following lines.
WITH DtldCustLedgEntry3 DO BEGIN
SETCURRENTKEY("Cust. Ledger Entry No.");
SETRANGE("Cust. Ledger Entry No.",DtldCustLedgEntry."Cust. Ledger Entry No.");
SETFILTER("Applies-to Bill No.",'<>%1','');
SETRANGE(Unapplied,TRUE);
EntryUnapplied := NOT ISEMPTY;
END;
PostReceivableDocs(EntryUnapplied);
// End of the added lines.
IF NOT GLEntryTmp.FINDFIRST AND ExistDtldCVLedgEntryBuf THEN BEGIN
InitGLEntry(CustPostingGr."Receivables Account",PositiveLCYAppAmt,PositiveACYAppAmt,FALSE,TRUE);
InsertGLEntry(FALSE);
InitGLEntry(CustPostingGr."Receivables Account",NegativeLCYAppAmt,NegativeACYAppAmt,FALSE,TRUE);
...