...
LOCAL PROCEDURE IdentifyCashPayments@1100010(CustomerNo@1100000 : Code[20];VATRegistrationNo@1100002 : Text[20]);
VAR
CustLedgerEntry@1100001 : Record 21;
BEGIN
// es0020.begin
CustLedgerEntry.SETCURRENTKEY("Document Type","Customer No.","Posting Date","Currency Code");
CustLedgerEntry.SETRANGE("Document Type",CustLedgerEntry."Document Type"::Payment);
...
...
LOCAL PROCEDURE IdentifyCashPayments@1100010(CustomerNo@1100000 : Code[20];VATRegistrationNo@1100002 : Text[20]);
VAR
CustLedgerEntry@1100001 : Record 21;
// Add the following line.
DocumentPostingDate@1170000000 : Date;
BEGIN
// es0020.begin
CustLedgerEntry.SETCURRENTKEY("Document Type","Customer No.","Posting Date","Currency Code");
CustLedgerEntry.SETRANGE("Document Type",CustLedgerEntry."Document Type"::Payment);
...
...
CustLedgerEntry.SETCURRENTKEY("Document Type","Customer No.","Posting Date","Currency Code");
CustLedgerEntry.SETRANGE("Document Type",CustLedgerEntry."Document Type"::Payment);
CustLedgerEntry.SETRANGE("Customer No.",CustomerNo);
// Delete the following lines.
CustLedgerEntry.SETRANGE("Posting Date",FromDate,ToDate);
IF CustLedgerEntry.FINDSET THEN
REPEAT
IF (CustLedgerEntry."Bal. Account Type" = CustLedgerEntry."Bal. Account Type"::"G/L Account") AND
(CustLedgerEntry."Bal. Account No." <> '')
THEN BEGIN
IF IsCashAccount(CustLedgerEntry."Bal. Account No.") THEN
CreateCashTotals(CustLedgerEntry."Entry No.",VATRegistrationNo);
END ELSE
IF ((CustLedgerEntry."Bal. Account No." = '') OR
(CustLedgerEntry."Bal. Account Type" <> CustLedgerEntry."Bal. Account Type"::"G/L Account"))
THEN BEGIN
IF IdentifyCashPaymentsFromGL(CustLedgerEntry) THEN
CreateCashTotals(CustLedgerEntry."Entry No.",VATRegistrationNo);
END;
// End of the deleted lines.
UNTIL CustLedgerEntry.NEXT = 0;
// es0020.end
END;
...
...
CustLedgerEntry.SETCURRENTKEY("Document Type","Customer No.","Posting Date","Currency Code");
CustLedgerEntry.SETRANGE("Document Type",CustLedgerEntry."Document Type"::Payment);
CustLedgerEntry.SETRANGE("Customer No.",CustomerNo);
// Add the following lines.
// we need payments made in future.
// CustLedgerEntry.SETRANGE("Posting Date",FromDate,ToDate);
IF CustLedgerEntry.FINDSET THEN
REPEAT
DocumentPostingDate := GetPaymentDocumentPostingDate(CustLedgerEntry);
IF (CheckCashTotalsPossibility(CustLedgerEntry,DocumentPostingDate)) THEN
CreateCashTotals(CustLedgerEntry."Entry No.",VATRegistrationNo,DocumentPostingDate);
// End of the added lines.
UNTIL CustLedgerEntry.NEXT = 0;
// es0020.end
END;
...