XRechnung 2.1.0 · CII

BR-DEC-20

XRechnung 2.1.0 · CII

fatalcountry

Original rule text

[BR-DEC-20]-The allowed maximum number of decimals for the VAT category tax amount (BT-117) is 2.

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

What this rule requires

The rule requires the VAT category tax amount (BT-117) in each tax subtotal to have no more than two decimal places. For UBL this is cac:TaxTotal/cac:TaxSubtotal/cbc:TaxAmount, and for CII it is ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax/ram:CalculatedAmount. A document fails if the value has more than two digits after the decimal point, such as 19.999. Values with no decimal point or with one or two decimal places pass.

How to fix

Change the VAT category tax amount to a value with at most two decimal places, for example by rounding to two decimals. In UBL, set cbc:TaxAmount in the affected cac:TaxSubtotal; in CII, set ram:CalculatedAmount in the affected ram:ApplicableTradeTax. If the amount is generated by a system, configure it to format or round this field to a maximum of two decimal places.

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