How to Fix KoSIT Error BR-CO-17: VAT Tax Amount Mismatch
KoSIK v1.6.3 rejects invoices where BT-117 (VAT tax amount) does not match the calculated value from BT-116 (taxable amount) and BT-119 (VAT rate). This is triggered by incorrect VAT calculations, such as applying VAT to a gross total. The fix is to recalculate BT-117 as (BT-116 × BT-119 / 100), rounded to two decimals.
1. Why KoSIT Validator v1.6.3 Rejects This Invoice
BR-CO-17 ensures VAT tax amounts are mathematically consistent with taxable amounts and VAT rates. The XPath test verifies that the calculated tax amount (BT-117) matches the expected value derived from the taxable amount (BT-116) and VAT rate (BT-119), within a ±1.00 tolerance. This applies to both CII (XRechnung) and UBL formats. If the calculation is off, the invoice is rejected as non-compliant with EN 16931.
//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax(round(.[normalize-space(upper-case(ram:TypeCode)) = 'VAT']/xs:decimal(ram:RateApplicablePercent)) = 0 and (round(xs:decimal(ram:CalculatedAmount)) = 0)) or (round(.[normalize-space(upper-case(ram:TypeCode)) = 'VAT']/xs:decimal(ram:RateApplicablePercent)) != 0 and ((abs(xs:decimal(ram:CalculatedAmount)) - 1 <= round(abs(xs:decimal(ram:BasisAmount)) * (.[normalize-space(upper-case(ram:TypeCode)) = 'VAT']/xs:decimal(ram:RateApplicablePercent) div 100) * 10 * 10) div 100 ) and (abs(xs:decimal(ram:CalculatedAmount)) + 1 >= round(abs(xs:decimal(ram:BasisAmount)) * (.[normalize-space(upper-case(ram:TypeCode)) = 'VAT']/xs:decimal(ram:RateApplicablePercent) div 100) * 10 * 10) div 100 ))) or (not(exists(.[normalize-space(upper-case(ram:TypeCode))='VAT']/xs:decimal(ram:RateApplicablePercent))) and (round(xs:decimal(ram:CalculatedAmount)) = 0))cac:TaxTotal/cac:TaxSubtotal2. KoSIT-Verified XML Example: Broken vs. Fixed
</ram:SpecifiedTradeSettlementPaymentMeans>
<ram:ApplicableTradeTax>
<ram:CalculatedAmount>452.20</ram:CalculatedAmount>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:BasisAmount>2000.00</ram:BasisAmount>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:SpecifiedTradePaymentTerms>
</ram:SpecifiedTradeSettlementPaymentMeans>
<ram:ApplicableTradeTax>
<ram:CalculatedAmount>380.00</ram:CalculatedAmount>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:BasisAmount>2000.00</ram:BasisAmount>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:SpecifiedTradePaymentTerms>
In the broken XML, the CalculatedAmount (452.20) does not match the expected value of 2000.00 × 19% = 380.00. The fixed XML corrects this by setting CalculatedAmount to 380.00, which passes KoSIT v1.6.3 validation with no errors.
3. Step-by-Step Fix Checklist
- Step 1: Inspect the <ram:ApplicableTradeTax> element, specifically <ram:CalculatedAmount>, <ram:BasisAmount>, and <ram:RateApplicablePercent>.
- Step 2: Recalculate <ram:CalculatedAmount> using the formula: (BasisAmount × RateApplicablePercent / 100), rounded to two decimal places.
- Step 3: Re-validate the XML using Beleq's free KoSIT v1.6.3 validator to ensure the correction passes all BR-CO-17 checks.
4. Common Shopify Store & DATEV Workflow Trigger
Shopify B2B merchants often trigger BR-CO-17 when applying VAT to the wrong total (e.g., gross instead of net) or failing to recalculate VAT after discounts or refunds. This causes mismatches between BT-116 and BT-117. Beleq helps by validating the XML against KoSIT 1.6.3 before sending to DATEV, ensuring that the VAT calculation is correct and compliant.
5. Frequently Asked Questions
What is the rounding rule for BR-CO-17?
The VAT tax amount (BT-117) must be rounded to two decimal places using standard rounding rules. The result must match the calculated value from BT-116 × BT-119 / 100, within a ±1.00 tolerance.
Does this rule apply to ZUGFeRD 2.3 as well?
Yes, BR-CO-17 applies to both XRechnung 3.0 and ZUGFeRD 2.3, as they are both based on EN 16931. The rule ensures VAT calculations are consistent across all EN 16931-compliant formats.
Related KoSIT Error Codes
Check your hybrid ZUGFeRD PDF or XRechnung XML in under 1 second against the official German KoSIT Validator v1.6.3 — 100% RAM-based on Frankfurt servers with zero retention and no registration.
Open Free KoSIT v1.6.3 Validator → See Beleq for Shopify