# BR-DE-19

Source: https://xmlvalid.com/rules/BR-DE-19

> "Payment account identifier" (BT-84) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 58 SEPA als Zahlungsmittel gefordert wird.

- Level: warning
- Rule sets: XRechnung 3.0 rules (UBL) 2.6.0
- Context: `/ubl:Invoice/cac:PaymentMeans[normalize-space(cbc:PaymentMeansCode) = ('30','58')] | /cn:CreditNote/cac:PaymentMeans[normalize-space(cbc:PaymentMeansCode) = ('30','58')]`
- Test: `not(normalize-space(cbc:PaymentMeansCode) = '58') or xr:checkIBAN(string(cac:PayeeFinancialAccount/cbc:ID))`

> "Payment account identifier" (BT-84) soll eine korrekte IBAN enthalten, wenn in "Payment means type code" (BT-81) mit dem Code 58 SEPA als Zahlungsmittel gefordert wird.

- Level: warning
- Rule sets: XRechnung 3.0 rules (CII) 2.6.0
- Context: `/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[normalize-space(ram:TypeCode) = ('30','58')]`
- Test: `not(normalize-space(ram:TypeCode) = '58') or xr:checkIBAN(string(ram:PayeePartyCreditorFinancialAccount/ram:IBANID))`

## Why it fails

- The account in `cac:PayeeFinancialAccount/cbc:ID` for a SEPA credit transfer (code `58`) is not a valid IBAN: a typo, a missing digit, or an account number without the country and check digits.
- The IBAN contains characters other than letters, digits and spaces.

## How to fix it

- Give the full IBAN, with or without spaces. Its two check digits are verified, so a single wrong digit is caught; copy it from the bank statement rather than retyping it.

Validate a document against these rules: https://xmlvalid.com/validate
