Check the IBAN for SEPA payment type 59

Warning BR-DE-20 XRechnung

"Debited account identifier" (BT-91) should contain a valid IBAN if SEPA is required as a means of payment with code 59 in "Payment means type code" (BT-81).

Recommendation: The invoice remains valid but should be corrected so that it can be processed automatically.
What is wrong

When ram:TypeCode has the value 59, ram:PayerPartyDebtorFinancialAccount/ram:IBANID does not contain an IBAN that passes the IBAN check. The rule explicitly checks BT-91 in this case.

What the rule means

Payment type code 59 denotes a SEPA direct debit. For this payment type, the debited account identifier BT-91 must contain a valid IBAN.

Affected fields BT-91 BT-81
Please provide a valid debited account IBAN for SEPA direct debit 59

No valid IBAN for the debited account was recognized for payment type 59. You can correct the account identifier in the payment details.

What to do
  1. Check whether ram:TypeCode contains the value 59.
  2. Provide the valid IBAN of the debited account in ram:PayerPartyDebtorFinancialAccount/ram:IBANID.
  3. Check the value through FacturXInvoice.AddDebitorFinancialAccount(...) or FacturXInvoice.GetDebitorFinancialAccounts().
  4. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:SpecifiedTradeSettlementPaymentMeans>
  <ram:TypeCode>59</ram:TypeCode>
  <ram:PayerPartyDebtorFinancialAccount>
    <ram:IBANID>123</ram:IBANID>
  </ram:PayerPartyDebtorFinancialAccount>
</ram:SpecifiedTradeSettlementPaymentMeans>
✓ Correct
<ram:SpecifiedTradeSettlementPaymentMeans>
  <ram:TypeCode>59</ram:TypeCode>
  <ram:PayerPartyDebtorFinancialAccount>
    <ram:IBANID>DE89370400440532013000</ram:IBANID>
  </ram:PayerPartyDebtorFinancialAccount>
</ram:SpecifiedTradeSettlementPaymentMeans>
Check in FactoorSharp
  • FacturXInvoice.GetDebitorFinancialAccounts() (BT-91)
  • PaymentMeans.TypeCode (SpecifiedPaymentMeans: BT-81)
  • FacturXInvoice.PaymentMeans (ID: BT-81)
  • FacturXInvoice.AddDebitorFinancialAccount(iban, bic, id, bankleitzahl, bankName, name) (BT-91)
Technical details

The test passes other payment type codes. When ram:TypeCode equals 59, the ram:IBANID of the debtor’s account is passed to xr:checkIBAN.

Where the rule applies

The rule applies to document-level ram:SpecifiedTradeSettlementPaymentMeans when ram:TypeCode has the value 59.

Original message from the Schematron
"Debited account identifier" (BT-91) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 59 SEPA als Zahlungsmittel gefordert wird.
Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedTradeSettlementPaymentMeans[normalize-space(ram:TypeCode) = '59']
Test expression (assert/@test)
not(normalize-space(ram:TypeCode) = '59') or xr:checkIBAN(string(ram:PayerPartyDebtorFinancialAccount/ram:IBANID))