Calculate the VAT amount at the standard rate

Error BR-S-09 EN 16931

The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is "Standard rated" shall equal the VAT category taxable amount (BT-116) multiplied by the VAT category rate (BT-119).

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

The amount in CalculatedAmount does not match the VAT amount calculated from BasisAmount and RateApplicablePercent. The test compares absolute values and allows a difference of less than one unit.

What the rule means

For category S, the VAT amount must be based on the taxable amount and the stated rate. This keeps the tax amount and taxable basis in the VAT breakdown arithmetically consistent.

Affected fields BT-117 BG-23 BT-118 BT-116 BT-119
Please align the VAT amount for `CategoryCode` `S`

The VAT amount does not match the taxable basis and rate in this VAT breakdown. Adjust the tax details so that they are arithmetically consistent.

What to do
  1. Review the tax details in AddApplicableTradeTax(...).
  2. Align CalculatedAmount with BasisAmount and RateApplicablePercent.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:ApplicableTradeTax>
  <ram:CategoryCode>S</ram:CategoryCode>
  <ram:BasisAmount>100</ram:BasisAmount>
  <ram:RateApplicablePercent>19</ram:RateApplicablePercent>
  <ram:CalculatedAmount>10</ram:CalculatedAmount>
</ram:ApplicableTradeTax>
✓ Correct
<ram:ApplicableTradeTax>
  <ram:CategoryCode>S</ram:CategoryCode>
  <ram:BasisAmount>100</ram:BasisAmount>
  <ram:RateApplicablePercent>19</ram:RateApplicablePercent>
  <ram:CalculatedAmount>19</ram:CalculatedAmount>
</ram:ApplicableTradeTax>
Check in FactoorSharp
  • TaxCategoryCodes (BT-118)
  • FacturXInvoice.AddApplicableTradeTax(basisAmount, percent, taxAmount, typeCode, categoryCode, allowanceChargeBasisAmount, exemptionReasonCode, exemptionReason, lineTotalBasisAmount) (BG-23)
  • FacturXInvoice.AnyApplicableTradeTaxes() (BG-23)
  • FacturXInvoice.GetApplicableTradeTaxes() (BG-23)
  • FacturXInvoice.Taxes (BG-23)
Technical details

The test multiplies BasisAmount by RateApplicablePercent, rounds the result and compares it with the absolute value of CalculatedAmount, allowing a tolerance of less than one unit.

Where the rule applies

The rule applies to CalculatedAmount, BasisAmount and RateApplicablePercent in a VAT breakdown ApplicableTradeTax with CategoryCode S.

Context (rule/@context)
//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode[.='S']
Test expression (assert/@test)
(abs(xs:decimal(../ram:CalculatedAmount)) - 1 < round(abs(xs:decimal(../ram:BasisAmount)) * ../ ram:RateApplicablePercent) div 100 ) and (abs(xs:decimal(../ram:CalculatedAmount)) + 1 > round(abs(xs:decimal(../ ram:BasisAmount)) * ../ram:RateApplicablePercent) div 100 )
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