BR-DEC-16
XRechnung 2.0.2 · UBL
Original rule text
[BR-DEC-16]-The allowed maximum number of decimals for the Paid amount (BT-113) is 2.
string-length(substring-after(cbc:PrepaidAmount,'.'))<=2What this rule requires
The rule requires that the Paid amount (BT-113) in cac:LegalMonetaryTotal/cbc:PrepaidAmount (UBL) or ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TotalPrepaidAmount (CII) has at most two digits after the decimal point. The test fails when the substring after the '.' has a length greater than 2, for example 123.456. This is a fatal rule, so a document with more than two decimal places in this amount fails validation.
How to fix
Set the Paid amount (BT-113) to a value with no more than two decimal places, e.g. 123.45 is allowed but 123.456 is not. In UBL change cbc:PrepaidAmount; in CII change ram:TotalPrepaidAmount. If the value is calculated or entered by a user, ensure the producing system limits or rounds the amount to two decimal places.
Guidance on this rule. The original text above is authoritative.