XRechnung 2.0.2 · UBL

BR-DE-19

XRechnung 2.0.2 · UBL

warningcountry

Original rule text

[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.

Stored validation assertion
not(cbc:PaymentMeansCode = '58') or                     matches(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and                     xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return  (if($cp > 64) then string($cp - 55) else  string($cp - 48)),'')) mod 97 = 1

What this rule requires

The rule checks payment means where the payment means code is '30' or '58'. It only requires an IBAN when the code is '58' (SEPA). In that case, the payment account identifier (BT-84) must pass the IBAN validation function xr:checkIBAN. Since the severity is warning, the validator reports this but does not reject the document.

How to fix

For UBL: in cac:PaymentMeans with cbc:PaymentMeansCode = 58, provide a syntactically valid IBAN in cac:PayeeFinancialAccount/cbc:ID. For CII: in ram:SpecifiedTradeSettlementPaymentMeans with ram:TypeCode = 58, provide a valid IBAN in ram:PayeePartyCreditorFinancialAccount/ram:IBANID. If the code is 30, no change is needed for this rule. Check the value against the IBAN checksum that xr:checkIBAN applies.

Guidance on this rule. The original text above is authoritative.