BR-DEC-01
XRechnung 2.2.0 · UBL
Original rule text
[BR-DEC-01]-The allowed maximum number of decimals for the Document level allowance amount (BT-92) is 2.
string-length(substring-after(cbc:Amount,'.'))<=2What this rule requires
The rule checks that the document level allowance amount (BT-92, German: "Dokumentenebene Nachlassbetrag") has no more than two decimal places. In UBL this is cbc:Amount inside an cac:AllowanceCharge where cbc:ChargeIndicator is false; in CII it is the ram:ActualAmount belonging to the specified trade allowance charge whose ChargeIndicator is false. The test counts the characters after the decimal point and fails if that number is greater than 2. Because the severity is fatal, the document is rejected if the amount has more than two decimal places.
How to fix
Change the document level allowance amount to a value with at most two decimal places (e.g. round to two decimal places before output). In UBL set /ubl:Invoice/cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cbc:Amount (or the CreditNote equivalent) to a numeric value with no more than two digits after the decimal point. In CII set the corresponding ram:ActualAmount in the specified trade allowance charge to a value with no more than two decimal places.
Guidance on this rule. The original text above is authoritative.