Beleq / Validator / KoSIT Error Codes / BR-CO-17
FATAL · BR-CO-17 EN 16931 (v1.3.16) Verified with KoSIT v1.6.3 (0-Error Fix) BT-116BT-117BT-119

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.

Official KoSIT v1.6.3 Schematron Message (EN16931 XRechnung (CII))
[BR-CO-17]-VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (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.

CII Context: //ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax
CII Schematron Test: (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))
UBL Context: cac:TaxTotal/cac:TaxSubtotal

2. KoSIT-Verified XML Example: Broken vs. Fixed

✕ Invalid CII XML — Rejected by KoSIT 1.6.3 (BR-CO-17)
</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>
✓ Fixed CII XML — Passed KoSIT 1.6.3 (0 Errors)
</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

  1. Step 1: Inspect the <ram:ApplicableTradeTax> element, specifically <ram:CalculatedAmount>, <ram:BasisAmount>, and <ram:RateApplicablePercent>.
  2. Step 2: Recalculate <ram:CalculatedAmount> using the formula: (BasisAmount × RateApplicablePercent / 100), rounded to two decimal places.
  3. 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.

Guide (DE): Shopify DATEV EXTF Export (SKR03 & SKR04) →

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

Validate your ZUGFeRD PDF or XRechnung XML free online

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