...
CLEAR(ErrorMessage);
MaxErrors := ARRAYLEN(ErrorMessage);
…
IF GenJnlLine.FINDFIRST THEN
REPEAT
IF AccNo <> GenJnlLine."Account No." THEN
CASE GenJnlLine."Account Type" OF
GenJnlLine."Account Type"::Customer :
BEGIN
Customer.GET(GenJnlLine."Account No.");
CustBankAcc.SETRANGE("Customer No.",Customer."No.");
CustBankAcc.SETRANGE(Clearing,TRUE);
IF NOT CustBankAcc.FINDFIRST THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400011+
Text1105400012,Customer."No.",CustBankAcc.FIELDCAPTION(Clearing)),1,150);
END ELSE BEGIN
IF PaymentSetup."SEPA Identification" = '' THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400049,PaymentSetup.FIELDCAPTION("SEPA Identification")),1,150);
END;
IF CustBankAcc."Mandate Identification" = '' THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400050+
Text1105400014,CustBankAcc.FIELDCAPTION("Mandate Identification"),Customer."No.",
CustBankAcc.Name),1,150);
END;
...
...
CLEAR(ErrorMessage);
MaxErrors := ARRAYLEN(ErrorMessage);
// Add the following line.
CheckIdent := TRUE;
...
IF GenJnlLine.FINDFIRST THEN
REPEAT
IF AccNo <> GenJnlLine."Account No." THEN
CASE GenJnlLine."Account Type" OF
GenJnlLine."Account Type"::Customer :
BEGIN
// Add the following lines.
PaymLine.RESET;
PaymLine.SETCURRENTKEY("Account Type","Account No.","Posting Date");
PaymLine.SETRANGE("Account Type",PaymLine."Account Type"::Customer);
PaymLine.SETRANGE("Account No.",GenJnlLine2."Account No.");
PaymLine.SETRANGE("Posting Date",GenJnlLine2."Posting Date");
PaymLine.SETRANGE(PaymLine."Applies-to Doc. No.",GenJnlLine2."Applies-to Doc. No.");
IF PaymLine.FINDLAST THEN BEGIN
PaymLedgEntry.SETRANGE("payment no.",paymline."payment no.");
IF NOT PaymLedgEntry.ISEMPTY THEN
PaymLedgEntry.FINDFIRST;
CheckIdent := (PaymLedgEntry.Type<>PaymLedgEntry.Type::"Customer Credit");
END;
CheckIdent := NOT (GenJnlLine."Applies-to Doc. Type" IN [GenJnlLine."Applies-to Doc. Type"::"Credit Memo",
GenJnlLine."Applies-to Doc. Type"::Refund]) AND
(GenJnlLine."Account Type" = GenJnlLine."Account Type"::Customer); //End of the lines.
Customer.GET(GenJnlLine."Account No.");
CustBankAcc.SETRANGE("Customer No.",Customer."No.");
CustBankAcc.SETRANGE(Clearing,TRUE);
IF NOT CustBankAcc.FINDFIRST THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400011+
Text1105400012,Customer."No.",CustBankAcc.FIELDCAPTION(Clearing)),1,150);
END ELSE BEGIN
// Add the following line.
IF CheckIdent THEN BEGIN
IF PaymentSetup."SEPA Identification" = '' THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400049,PaymentSetup.FIELDCAPTION("SEPA Identification")),1,150);
END;
IF CustBankAcc."Mandate Identification" = '' THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400050+
Text1105400014,CustBankAcc.FIELDCAPTION("Mandate Identification"),Customer."No.",
CustBankAcc.Name),1,150);
END;
IF CustBankAcc."Date of Signature" = 0D THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400050+
Text1105400014,CustBankAcc.FIELDCAPTION("Date of Signature"),Customer."No.",
CustBankAcc.Name),1,150);
END;
// Add the following line.
END;
...
lines.
Customer.GET(GenJnlLine."Account No.");
CustBankAcc.SETRANGE("Customer No.",Customer."No.");
CustBankAcc.SETRANGE(Clearing,TRUE);
IF NOT CustBankAcc.FINDFIRST THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400011+
Text1105400012,Customer."No.",CustBankAcc.FIELDCAPTION(Clearing)),1,150);
END ELSE BEGIN
// Add the following line.
IF CheckIdent THEN BEGIN
IF PaymentSetup."SEPA Identification" = '' THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400049,PaymentSetup.FIELDCAPTION("SEPA Identification")),1,150);
END;
IF CustBankAcc."Mandate Identification" = '' THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400050+
Text1105400014,CustBankAcc.FIELDCAPTION("Mandate Identification"),Customer."No.",
CustBankAcc.Name),1,150);
END;
IF CustBankAcc."Date of Signature" = 0D THEN BEGIN
ErrorCounter := ErrorCounter + 1;
IF ErrorCounter <= MaxErrors THEN
ErrorMessage[ErrorCounter] :=
COPYSTR(
STRSUBSTNO(
Text1105400050+
Text1105400014,CustBankAcc.FIELDCAPTION("Date of Signature"),Customer."No.",
CustBankAcc.Name),1,150);
END;
// Add the following line.
END;
...