# BR-S-09

Source: https://xmlvalid.com/rules/BR-S-09

> 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).

- Level: error
- Rule sets: EN 16931 rules (UBL) 1.3.17, EN 16931 rules 1.3.16 (UBL), Romanian RO e-Factura rules (UBL) 1.0.9
- Context: `/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']`
- Test: `(abs(xs:decimal(../cbc:TaxAmount)) - 1 < round((abs(xs:decimal(../cbc:TaxableAmount)) * (xs:decimal(cbc:Percent) div 100)) * 10 * 10) div 100 ) and (abs(xs:decimal(../cbc:TaxAmount)) + 1 > round((abs(xs:decimal(../cbc:TaxableAmount)) * (xs:decimal(cbc:Percent) div 100)) * 10 * 10) div 100 )`

> 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).

- Level: error
- Rule sets: EN 16931 rules (CII) 1.3.17
- Context: `//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode[.='S']`
- Test: `(abs(xs:decimal(../ram:CalculatedAmount)) - 1 < round(abs(xs:decimal(../ram:BasisAmount)) * xs:decimal(../ram:RateApplicablePercent)) div 100 ) and (abs(xs:decimal(../ram:CalculatedAmount)) + 1 > round(abs(xs:decimal(../ram:BasisAmount)) * xs:decimal(../ram:RateApplicablePercent)) div 100 )`

> 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).

- Level: error
- Rule sets: EN 16931 rules 1.3.16 (CII), Factur-X BASIC WL rules 1.09, Factur-X EN 16931 rules 1.09.2
- Context: `//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode[.='S']`
- 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 )`

## Why it fails

- The VAT amount of a standard rated breakdown is not its taxable amount × rate, for example because VAT was rounded per line and then added up.

## How to fix it

- Calculate the breakdown's VAT amount from its taxable amount and rate, rounded to two decimals. The rule allows a difference of up to 1 in either direction.

Validate a document against these rules: https://xmlvalid.com/validate
