VAT amount must match the taxable amount and rate

Error BR-CO-17 EN 16931

VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

For a tax type of VAT, ram:CalculatedAmount does not match ram:BasisAmount multiplied by ram:RateApplicablePercent and rounded to two decimal places. If no rate is present for VAT, the rounded VAT amount must be zero.

What the rule means

The VAT amount for each category is calculated from the taxable amount and the VAT rate. The invoice must reflect this relationship with rounding to two decimal places.

Affected fields BT-117 BT-116 BT-119
Please match the VAT amount to the taxable amount and rate

The stated VAT amount does not match the taxable amount and VAT rate. Adjust the amount to the calculation rounded to two decimal places.

What to do
  1. Check ram:BasisAmount and ram:RateApplicablePercent.
  2. Calculate the VAT amount from them and round it to two decimal places.
  3. Enter the result in ram:CalculatedAmount.
  4. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:ApplicableTradeTax>
  <ram:TypeCode>VAT</ram:TypeCode>
  <ram:BasisAmount>100.00</ram:BasisAmount>
  <ram:RateApplicablePercent>19</ram:RateApplicablePercent>
  <ram:CalculatedAmount>20.00</ram:CalculatedAmount>
</ram:ApplicableTradeTax>
✓ Correct
<ram:ApplicableTradeTax>
  <ram:TypeCode>VAT</ram:TypeCode>
  <ram:BasisAmount>100.00</ram:BasisAmount>
  <ram:RateApplicablePercent>19</ram:RateApplicablePercent>
  <ram:CalculatedAmount>19.00</ram:CalculatedAmount>
</ram:ApplicableTradeTax>
Technical details

The test evaluates ram:CalculatedAmount for tax type VAT using ram:BasisAmount and ram:RateApplicablePercent; the calculated value is rounded to two decimal places. If no rate exists, the rounded amount must be zero.

Where the rule applies

The rule applies to each ram:ApplicableTradeTax in the invoice header settlement data.

Context (rule/@context)
//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax
Test expression (assert/@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) )
Changes in the KoSIT validation rules
  • 2023-05-122023-05-12 · AddedTest for BR-CO-17 and BR-S-09 rounding rules in UBL
  • 2023-05-122023-05-12 · ChangedTests for BR-CO-17 and BR-S-09 rounding rules in CII merged
  • 2023-01-312023-01-31 · AddedTest for BR-CO-17 on currencies with rounding at totals in CII.