# BR-AF-01 IGIC category requires a matching VAT breakdown

An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151, BT-95 or BT-102) is "IGIC" shall contain in the VAT breakdown (BG-23) at least one VAT category code (BT-118) equal with "IGIC".

## Problem Description

An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151, BT-95 or BT-102) is "IGIC" shall contain in the VAT breakdown (BG-23) at least one VAT category code (BT-118) equal with "IGIC".

> **ERROR**: XRechnung 3.0

## Context and Significance

The IGIC VAT category (code "L", the Canary Islands indirect tax) comes from the updated EN16931 code lists supported by the current XRechnung 3.0.2 rulepack; this rule keeps every IGIC line reconcilable against a matching VAT breakdown.

## Solution

Add a cac:TaxTotal/cac:TaxSubtotal (BG-23) whose cac:TaxCategory/cbc:ID is "L" (IGIC) so the breakdown mirrors the IGIC lines, allowances or charges.

- validate
- convert

## Valid Examples

- Invoice line with category "L" (IGIC) at 7.00 % and a BG-23 breakdown group with BT-118 = "L"

## Invalid Examples

- An invoice line uses category "L" (IGIC) but the only BG-23 breakdown group carries BT-118 = "S"

## Code Examples

### Valid XML
```
<cac:InvoiceLine>
  <cac:Item>
    <cac:ClassifiedTaxCategory>
      <cbc:ID>L</cbc:ID>
      <cbc:Percent>7.00</cbc:Percent>
      <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
    </cac:ClassifiedTaxCategory>
  </cac:Item>
</cac:InvoiceLine>
<cac:TaxTotal>
  <cac:TaxSubtotal>
    <cac:TaxCategory>
      <cbc:ID>L</cbc:ID>
      <cbc:Percent>7.00</cbc:Percent>
      <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
    </cac:TaxCategory>
  </cac:TaxSubtotal>
</cac:TaxTotal>
```

### Invalid XML
```
<cac:InvoiceLine>
  <cac:Item>
    <cac:ClassifiedTaxCategory>
      <cbc:ID>L</cbc:ID>
      <cbc:Percent>7.00</cbc:Percent>
      <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
    </cac:ClassifiedTaxCategory>
  </cac:Item>
</cac:InvoiceLine>
<cac:TaxTotal>
  <cac:TaxSubtotal>
    <cac:TaxCategory>
      <cbc:ID>S</cbc:ID>
      <cbc:Percent>19.00</cbc:Percent>
      <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
    </cac:TaxCategory>
  </cac:TaxSubtotal>
</cac:TaxTotal>
```

## Affected Fields

- [BT-118 VAT category code](/resources/xrechnung/bt-118-vat-category-code)
- [BT-151 Invoiced item VAT category code](/resources/xrechnung/bt-151-invoice-line-vat-category-code)
- [BG-23 VAT breakdown](/resources/xrechnung)

## Related Rules

- [BR-AF-02](/resources/kosit-validator-errors/br-af-02-igic-line-seller-vat-identifier-required)
- [BR-CO-18](/resources/kosit-validator-errors/br-co-18-vat-breakdown-required)

## Validation Tools

- [Official KoSIT Validator](https://erechnungsvalidator.service-bw.de/): Validate your XRechnung files against all BR-DE rules.
- [Convert PDF to XRechnung](/pdf-to-xrechnung): Automatic validation error fixes when converting.

## Related Resources

- [Official Specification](https://xeinkauf.de/xrechnung/)
- [Test Suite](https://github.com/itplr-kosit/xrechnung-testsuite)
- [Complete Error List](/resources/kosit-validator-errors): Overview of all German XRechnung validation rules.
