BR-CO-14
Invoice total VAT amount (BT-110) = Σ VAT category tax amount (BT-117).
Why it fails
- The VAT total in
cac:TaxTotal/cbc:TaxAmountwas calculated over the whole invoice, while the VAT breakdowns (cac:TaxSubtotal) were rounded per category, or the other way round. - A VAT breakdown is missing for one of the VAT categories or rates used on the lines.
How to fix it
Make BT-110 the sum of the cbc:TaxAmount of every cac:TaxSubtotal (BT-117), each already rounded to two decimals.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
/ubl:Invoice/cac:TaxTotal | /cn:CreditNote/cac:TaxTotal
(xs:decimal(child::cbc:TaxAmount)= round((sum(cac:TaxSubtotal/xs:decimal(cbc:TaxAmount)) * 10 * 10)) div 100) or not(cac:TaxSubtotal)
Checked with EN 16931 Invoice (UBL), EN 16931 Credit Note (UBL), Croatia eRačun Invoice (UBL), Croatia eRačun Credit Note (UBL)
//ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode]
. = (round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax/ram:CalculatedAmount/xs:decimal(.))*10*10)div 100)
Checked with EN 16931 Invoice (CII)
//ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID=/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode]
. = (round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax/ram:CalculatedAmount)*10*10)div 100)
Checked with France e-invoice (CII), XRechnung 3.0 Invoice (CII)