BR-DE-18
XRechnung 2.3.0 · CII
Original rule text
[BR-DE-18] Skonto Zeilen in muessen diesem regulärem Ausdruck entsprechen: . Die Informationen zur Gewährung von Skonto müssen wie folgt im Element "Payment terms" (BT-20) übermittelt werden: Anzugeben ist im ersten Segment "SKONTO", im zweiten "TAGE=n", im dritten "PROZENT=n". Prozentzahlen sind ohne Vorzeichen sowie mit Punkt getrennt von zwei Nachkommastellen anzugeben. Liegt dem zu berechnenden Betrag nicht BT-115, "fälliger Betrag" zugrunde, sondern nur ein Teil des fälligen Betrags der Rechnung, ist der Grundwert zur Berechnung von Skonto als viertes Segment "BASISBETRAG=n" gemäß dem semantischen Datentypen Amount anzugeben. Jeder Eintrag beginnt mit einer #, die Segmente sind mit einer # getrennt und eine Zeile schließt mit einer # ab. Am Ende einer vollständigen Skontoangabe muss ein XML-konformer Zeilenumbruch folgen. Alle Angaben zur Gewährung von Skonto müssen in Großbuchstaben gemacht werden. Zusätzliches Whitespace (Leerzeichen, Tabulatoren oder Zeilenumbrüche) ist nicht zulässig. Andere Zeichen oder Texte als in den oberen Vorgaben genannt sind nicht zulässig.
every $line in rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:Description[1]/tokenize(. , '(\r?\n)')[starts-with( normalize-space(.) , '#')] satisfies matches ( normalize-space ($line), $XR-SKONTO-REGEX ) and matches( rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:Description[1]/tokenize(. , '#.+#')[last()], '^\s*\n' )What this rule requires
This fatal rule checks ram:SpecifiedTradePaymentTerms/ram:Description (BT-20). Every line in that text that begins with # must match the discount pattern #SKONTO#TAGE=<days>#PROZENT=<percentage>#, optionally extended by #BASISBETRAG=<amount>#, where <days> is one or more digits, <percentage> is digits with a decimal point and exactly two decimal places, and <amount> is an optionally signed decimal amount. The complete text must end with a closing # followed by a newline. The check normalizes whitespace around each line before testing, so only the trimmed line content is compared.
How to fix
Set the payment terms text in ram:SpecifiedTradePaymentTerms/ram:Description so each discount entry is exactly like #SKONTO#TAGE=30#PROZENT=2.00# or, if only part of the amount due is the basis, #SKONTO#TAGE=30#PROZENT=2.00#BASISBETRAG=100.00#. Use all uppercase, no internal spaces or tabs, and end the entry with # followed by a newline. Check every line beginning with # against this pattern.
Guidance on this rule. The original text above is authoritative.