DE-R-020: If both supplier and customer are located in Germany, the element "Debited account…
Peppol BIS Billing 3.0.21 · UBL
Original rule text
[DE-R-020]-If both supplier and customer are located in Germany, the element "Debited account identifier" (BT-91) should contain a valid IBAN if code 59 SEPA is provided in "Payment means type code" (BT-81).
not(normalize-space(cbc:PaymentMeansCode) = '59') or matches(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:decimal(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then string($cp - 55) else string($cp - 48)),'')) mod 97 = 1DE-R-020 is a warning rule in the country layer of Peppol BIS Billing 3.0.21 · UBL. An invoice that breaks it is flagged but not rejected. It refers to BT-91, BT-81.
What this rule requires
This warning rule applies in UBL invoices and credit notes when the payment means code (cbc:PaymentMeansCode) is 59 and both the supplier and customer country codes (in cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode and cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) are DE. For such cases, the debited account identifier in cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID should be a valid IBAN: after whitespace is removed, it must match ^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$ and pass the modulo-97 check defined by the rule. If the payment means code is not 59, the rule does not require an IBAN. Because the severity is warning, a document that does not satisfy this rule is not rejected; the validator only reports it.
How to fix
If the invoice or credit note uses payment means code 59 and both supplier and customer country codes are DE, set cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID to a valid IBAN (the value must match the rule's pattern and pass its modulo-97 check). If the payment means code is not 59, no change is needed. Since this is a warning, fixing the element removes the advisory message.
Guidance on this rule. The original text above is authoritative.
Where to go next
DE-R-020 changed in 2 published Peppol BIS Billing UBL release comparisons:
- DE-R-020 in 3.0.20 → 3.0.21: Test expression rewritten
- DE-R-020 in 3.0.17 → 3.0.18: New rule
Validate an invoice against these rules · All release changes