# BR-CO-18

Source: https://xmlvalid.com/rules/BR-CO-18

> An Invoice shall at least have one VAT breakdown group (BG-23).

- Level: error
- Rule sets: EN 16931 rules (UBL) 1.3.17, EN 16931 rules 1.3.16 (UBL), EXTENDED-CTC-FR rules (UBL) 1.4.0.04, Romanian RO e-Factura rules (UBL) 1.0.9
- Context: `/ubl:Invoice | /cn:CreditNote`
- Test: `exists(cac:TaxTotal/cac:TaxSubtotal)`

> An Invoice shall at least have one VAT breakdown group (BG-23).

- Level: error
- Rule sets: EN 16931 rules (CII) 1.3.17, EN 16931 rules 1.3.16 (CII), EXTENDED-CTC-FR rules (CII) 1.4.0.04
- Context: `//ram:IncludedSupplyChainTradeLineItem`
- Test: `//rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax`

> An Invoice shall at least have one VAT breakdown group (BG-23).

- Level: error
- Rule sets: Factur-X BASIC WL rules 1.09, Factur-X EN 16931 rules 1.09.2, Factur-X EXTENDED rules 1.09.2
- Context: `//rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement`
- Test: `ram:ApplicableTradeTax`

## Why it fails

- The VAT total has no breakdown: `cac:TaxTotal` holds only a `cbc:TaxAmount` without `cac:TaxSubtotal` (`ram:ApplicableTradeTax` in the CII settlement).

## How to fix it

- Add a `cac:TaxSubtotal` per VAT category and rate, with its taxable amount, VAT amount, category and rate. An invoice without VAT still needs one, with category `O`, `E` or `Z` and a VAT amount of 0.

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