All error codes › BR-CO-17
BR-CO-17 – VAT amount of a rate is wrong
Erroren16931applies to Romanian e-Factura
What the rule says
VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals.
How to fix it
For each VAT rate: taxable amount x rate / 100, rounded to 2 decimals.
UBL: cac:TaxTotal/cac:TaxSubtotal/cbc:TaxAmount
Paste the XML and see every error with the exact fix and the correct amounts.
Where it is checked in the XML
Context: cac:TaxTotal/cac:TaxSubtotal
Test (XPath):
(round(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent)) = 0 and (round(xs:decimal(cbc:TaxAmount)) = 0)) or (round(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent)) != 0 and ((abs(xs:decimal(cbc:TaxAmount)) - 1 < round(abs(xs:decimal(cbc:TaxableAmount)) * (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) div 100) * 10 * 10) div 100 ) and (abs(xs:decimal(cbc:TaxAmount)) + 1 > round(abs(xs:decimal(cbc:TaxableAmount)) * (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) div 100) * 10 * 10) div 100 ))) or (not(exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent))) and (round(xs:decimal(cbc:TaxAmount)) = 0))
Related rules
BR-CO-03Both VAT point date and date code givenBR-CO-04Invoice line without VAT categoryBR-CO-05Document level allowance reason code (BT-98) and Document level allowance reason (BT-97)…BR-CO-06Document level charge reason code (BT-105) and Document level charge reason (BT-104)…BR-CO-07Invoice line allowance reason code (BT-140) and Invoice line allowance reason (BT-139)…BR-CO-08Invoice line charge reason code (BT-145) and Invoice line charge reason (BT-144) shall…BR-CO-09VAT ID without country prefixBR-CO-10Sum of line amounts is wrongBR-CO-11Sum of allowances on document level (BT-107) = Σ Document level allowance amount (BT-92)BR-CO-12Sum of charges on document level (BT-108) = Σ Document level charge amount (BT-99)BR-CO-13Total without VAT is wrongBR-CO-14Total VAT is wrong