Faktura

BR-DEC-15

fatalEN 16931EN 16931 business ruleCIIUBLBT-111

The allowed maximum number of decimals for the Invoice total VAT amount in accounting currency (BT-111) is 2.

Why it fails

Invoice total VAT amount in accounting currency (BT-111) is written with more than 2 decimal places.

How to fix it

Round BT-111 to 2 decimals before serialising it. This is a formatting rule, not an arithmetic one - the value itself is usually right, the XML just carries extra digits from a float. Format the amount as a fixed-point decimal string.

What the validator checks

CII — context $Document_totals

not(ram:TaxTotalAmount) or ram:TaxTotalAmount[(@currencyID =/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode and . = round(. * 100) div 100) or not (/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode)]

UBL — context /ubl:Invoice | /cn:CreditNote

(//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]))

Related rules

Part of BR-DEC — Decimal places.

Validate an invoice against this rule →