# BR-DEC-15

Source: https://xmlvalid.com/rules/BR-DEC-15

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

- Level: error
- Rule sets: EN 16931 rules (UBL) 1.3.17, EN 16931 rules 1.3.16 (UBL), EXTENDED-CTC-FR rules (UBL) 1.4.0.04, Romanian RO e-Factura rules (UBL) 1.0.9
- Context: `/ubl:Invoice | /cn:CreditNote`
- Test: `(//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]))`

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

- Level: error
- Rule sets: EN 16931 rules (CII) 1.3.17
- Context: `//ram:SpecifiedTradeSettlementHeaderMonetarySummation`
- Test: `not(ram:TaxTotalAmount) or ram:TaxTotalAmount[(@currencyID = /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode and xs:decimal(.) = round(xs:decimal(.) * 100) div 100) or not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode)]`

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

- Level: error
- Rule sets: EN 16931 rules 1.3.16 (CII), EXTENDED-CTC-FR rules (CII) 1.4.0.04, Factur-X BASIC WL rules 1.09, Factur-X EN 16931 rules 1.09.2, Factur-X EXTENDED rules 1.09.2
- Context: `//ram:SpecifiedTradeSettlementHeaderMonetarySummation`
- Test: `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)]`

Validate a document against these rules: https://xmlvalid.com/validate
