XRechnung 2.1.0 · CII

BR-DEC-17

XRechnung 2.1.0 · CII

fatalcountry

Original rule text

[BR-DEC-17]-The allowed maximum number of decimals for the Rounding amount (BT-114) is 2.

Stored validation assertion
string-length(substring-after(ram:RoundingAmount,'.'))<=2

What this rule requires

This fatal rule requires that the Rounding amount (BT-114) in the invoice has no more than two digits after the decimal point. In UBL it checks cbc:PayableRoundingAmount inside cac:LegalMonetaryTotal; in CII it checks ram:RoundingAmount inside ram:SpecifiedTradeSettlementHeaderMonetarySummation. The test measures the string length of the digits after the first .; a value such as 1.234 has three characters after the dot and is rejected. Because the test counts literal characters, a value like 1.200 also has three characters after the dot and does not satisfy the rule.

How to fix

Change the rounding amount to a value with at most two digits after the decimal point. For UBL, edit cbc:PayableRoundingAmount; for CII, edit ram:RoundingAmount. Use values such as 12.34 or 12.3, not 12.345 or 12.340. Ensure the generating system rounds, truncates, or formats the amount to no more than two decimal places, and does not output extra trailing zeros beyond the second decimal.

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