Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
1.2 kB
2
Indexable
Never
procedure FindMatchingEntry(BankAccNo: Code[20];TranDate: Date;TranAmount: Decimal;BankTranId: Text[35];BankTranRef: Text[35]): Integer
    var
        BankAccLedgEntry: Record "Bank Account Ledger Entry";
    begin
        //EE7.10->
        BankAccLedgEntry.SETRANGE("Bank Account No.",BankAccNo);
        IF BankTranId <> '' THEN BEGIN
          BankAccLedgEntry.SETRANGE("EE Bank Transaction ID",BankTranId);
          IF BankAccLedgEntry.FINDFIRST AND (BankAccLedgEntry.COUNT = 1) THEN
            IF (BankAccLedgEntry.Amount = TranAmount) AND (ABS(BankAccLedgEntry."Posting Date"-TranDate) < 10) THEN
              EXIT(BankAccLedgEntry."Entry No.");
          BankAccLedgEntry.SETRANGE("EE Bank Transaction ID");
        END;
        IF BankTranRef <> '' THEN BEGIN
          BankAccLedgEntry.SETRANGE("EE Bank Transaction Reference",BankTranRef);
          IF BankAccLedgEntry.FINDFIRST AND (BankAccLedgEntry.COUNT=1) THEN
            IF (BankAccLedgEntry.Amount = TranAmount) AND (ABS(BankAccLedgEntry."Posting Date"-TranDate) < 10) THEN
              EXIT(BankAccLedgEntry."Entry No.");
        END;
        //EE7.10<-
    end;
Leave a Comment