BR-DEC-15
XRechnung 2.4.0 · UBL
Original rule text
[BR-DEC-15]-The allowed maximum number of decimals for the Invoice total VAT amount in accounting currency (BT-111) is 2.
(//cac:TaxTotal/cbc:TaxAmount[@currencyID = cbc:TaxCurrencyCode] and (string-length(substring-after(//cac:TaxTotal/cbc:TaxAmount[@currencyID = cbc:TaxCurrencyCode],'.'))<=2)) or (not(//cac:TaxTotal/cbc:TaxAmount[@currencyID = cbc:TaxCurrencyCode]))What this rule requires
The rule enforces at most two decimal places for the invoice total VAT amount in accounting currency (BT-111, German: "Steuergesamtbetrag in Buchungswährung"). In UBL, if a cac:TaxTotal/cbc:TaxAmount has @currencyID equal to the invoice's cbc:TaxCurrencyCode, its value must have no more than two digits after the decimal point; if no such amount exists, the rule passes. In CII, if a ram:TaxTotalAmount exists and a ram:TaxCurrencyCode is present, there must be at least one ram:TaxTotalAmount whose @currencyID matches that code and whose value is equal to that value rounded to two decimal places.
How to fix
Set the accounting-currency VAT total amount to a value with at most two decimal places, e.g. 123.45 instead of 123.456. For UBL, correct cac:TaxTotal/cbc:TaxAmount[@currencyID = cbc:TaxCurrencyCode]; for CII, correct the value of ram:TaxTotalAmount with @currencyID equal to the tax currency code, or add such an amount if it is required. If the amount is computed, round it to two decimal places before including it.
Guidance on this rule. The original text above is authoritative.