einvoice / EN 16931 / XRechnung rule reference

BR-AF-08

What this rule means and how to fix it

For each different value of VAT category rate (BT-119) where the VAT category code (BT-118) is 'IGIC', the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) plus document level charge amounts (BT-99) minus document level allowance amounts (BT-92) where the VAT category code is 'IGIC' and the VAT rate equals BT-119.

Für jeden einzelnen Wert des Umsatzsteuersatzes der Umsatzsteuerkategorie (BT-119), bei dem der Code der Umsatzsteuerkategorie (BT-118) „IGIC (Kanarische Inseln)“ lautet, muss der nach Umsatzsteuerkategorie zu versteuernde Betrag (BT-116) in einer UMSATZSTEUERAUFSCHLÜSSELUNG (BG-23) gleich der Summe der Nettobeträge der Rechnungspositionen (BT-131) zuzüglich der Summe der Beträge der Zuschläge auf Dokumentenebene (BT-99) abzüglich der Summe der Beträge der Nachlässe auf Dokumentenebene (BT-92) sein, für die der Code der Umsatzsteuerkategorie (BT-151, BT-102, BT-95) „IGIC (Kanarische Inseln)“ lautet und der Umsatzsteuersatz (BT-152, BT-103, BT-96) gleich dem Umsatzsteuersatz der Umsatzsteuerkategorie (BT-119) ist.

Deutsche Fassung: Übersetzung der gleichen BT/BG-Semantik (translation — not the official assert).

Requires
For each different value of VAT category rate (BT-119) where the VAT category code (BT-118) is "IGIC", the VAT category taxable amount (BT-116) in a VAT breakdown (BG-23) shall equal the sum of Invoice line net amounts (BT-131) plus the sum of document level charge amounts (BT-99) minus the sum of document level allowance amounts (BT-92) where the VAT category code (BT-151, BT-102, BT-95) is "IGIC" and the VAT rate (BT-152, BT-103, BT-96) equals the VAT category rate (BT-119).
Business terms
BG-23 BT-92 BT-95 BT-96 BT-99 BT-102 BT-103 BT-116 BT-118 BT-119 BT-131 BT-151 BT-152
Syntax
Binds the UBL-2.1 Invoice / CreditNote syntax
Location (UBL-2.1 path)
/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'L'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']
Fix
Adjust the VAT breakdown at `/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'L'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']` so that For each different value of VAT category rate (BT-119) where the VAT category code (BT-118) is "IGIC", the VAT category taxable amount (BT-116) in a VAT breakdown (BG-23) shall equal the sum of Invoice line net amounts (BT-131) plus the sum of document level charge amounts (BT-99) minus the sum of document level allowance amounts (BT-92) where the VAT category code (BT-151, BT-102, BT-95) is "IGIC" and the VAT rate (BT-152, BT-103, BT-96) equals the VAT category rate (BT-119).
Fix (Deutsch)
Ergänzen Sie das erforderliche Element bei `/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'L'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']`: Für jeden einzelnen Wert des Umsatzsteuersatzes der Umsatzsteuerkategorie (BT-119), bei dem der Code der Umsatzsteuerkategorie (BT-118) „IGIC (Kanarische Inseln)“ lautet, muss der nach Umsatzsteuerkategorie zu versteuernde Betrag (BT-116) in einer UMSATZSTEUERAUFSCHLÜSSELUNG (BG-23) gleich der Summe der Nettobeträge der Rechnungspositionen (BT-131) zuzüglich der Summe der Beträge der Zuschläge auf Dokumentenebene (BT-99) abzüglich der Summe der Beträge der Nachlässe auf Dokumentenebene (BT-92) sein, für die der Code der Umsatzsteuerkategorie (BT-151, BT-102, BT-95) „IGIC (Kanarische Inseln)“ lautet und der Umsatzsteuersatz (BT-152, BT-103, BT-96) gleich dem Umsatzsteuersatz der Umsatzsteuerkategorie (BT-119) ist.
Severity
fatal
Provenance source
en16931-ubl
Provenance assert

For each different value of VAT category rate (BT-119) where the VAT category code (BT-118) is "IGIC", the VAT category taxable amount (BT-116) in a VAT breakdown (BG-23) shall equal the sum of Invoice line net amounts (BT-131) plus the sum of document level charge amounts (BT-99) minus the sum of document level allowance amounts (BT-92) where the VAT category code (BT-151, BT-102, BT-95) is "IGIC" and the VAT rate (BT-152, BT-103, BT-96) equals the VAT category rate (BT-119).

The Location above is a UBL-2.1 path, and no UN/CEFACT-CII path for this rule is published here; Fix and Fix (Deutsch), verbatim from remediation_catalog.json and not reworded here; the UBL-2.1 binding of this rule is differentially proven against the official CEN EN 16931 1.3.16 Schematron.

Where to check the fix: paste the corrected invoice into the browser validator at /einvoice/validate/ — it runs this same engine locally in your browser, with no upload, and stops reporting BR-AF-08 once the edit lands.

Korrektur prüfen: Laden Sie die geänderte Rechnung in den Browser-Validator unter /einvoice/validate/ — er führt dieselbe Engine lokal im Browser aus, ohne Upload, und meldet BR-AF-08 nicht mehr, sobald die Korrektur greift.

The same invoice, failing and fixed

Neither block below is hand-written, and neither is an illustration: both are cut verbatim out of corpus/cen-en16931/test/Invoice-unit-UBL/BR-IG-08-1.xml, the vendored unit test the CEN EN 16931 project ships for this rule. The people who wrote the Schematron wrote these two documents and labelled them <error>BR-AF-08</error> and <success>BR-AF-08</success>. They are published here only because this engine agreed with that labelling: it reported BR-AF-08 for the first document and did not report it for the second, under --profile en16931.

UBL Invoice — fails

The upstream case description: “Trigger error if for each different value of VAT category rate where the VAT category code is "L", the VAT category taxable amount in a VAT breakdown shall equal the sum of Invoice line net amounts plus the sum of document level charge amounts minus the sum of document level allowance amounts where the VAT category code is “L” and the VAT rate does not equal the VAT category rate .”

<Invoice
	xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
	xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
	xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
	<cac:TaxTotal>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="EUR">200</cbc:TaxableAmount>
			<cac:TaxCategory>
				<cbc:ID>L</cbc:ID>
				<cbc:Percent>25</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:InvoiceLine>
		<cbc:LineExtensionAmount currencyID="EUR">100</cbc:LineExtensionAmount>
		<cac:Item>
			<cac:ClassifiedTaxCategory>
				<cbc:ID>L</cbc:ID>
				<cbc:Percent>25</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:ClassifiedTaxCategory>
		</cac:Item>
	</cac:InvoiceLine>
</Invoice>

UBL Invoice — passes

The upstream case description: “Verify that for each different value of VAT category rate where the VAT category code is "L", the VAT category taxable amount in a VAT breakdown shall equal the sum of Invoice line net amounts plus the sum of document level charge amounts minus the sum of document level allowance amounts where the VAT category code is “L” and the VAT rate equals the VAT category rate .”

<Invoice
	xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
	xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
	xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
	<cac:TaxTotal>
		<cac:TaxSubtotal>
			<cbc:TaxableAmount currencyID="EUR">100</cbc:TaxableAmount>
			<cac:TaxCategory>
				<cbc:ID>L</cbc:ID>
				<cbc:Percent>25</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:TaxCategory>
		</cac:TaxSubtotal>
	</cac:TaxTotal>
	<cac:InvoiceLine>
		<cbc:LineExtensionAmount currencyID="EUR">100</cbc:LineExtensionAmount>
		<cac:Item>
			<cac:ClassifiedTaxCategory>
				<cbc:ID>L</cbc:ID>
				<cbc:Percent>25</cbc:Percent>
				<cac:TaxScheme>
					<cbc:ID>VAT</cbc:ID>
				</cac:TaxScheme>
			</cac:ClassifiedTaxCategory>
		</cac:Item>
	</cac:InvoiceLine>
</Invoice>

What the engine reports for the failing document

{
  "element": "cac:TaxTotal/cac:TaxSubtotal/cbc:TaxableAmount",
  "field": "cac:TaxTotal/cac:TaxSubtotal/cbc:TaxableAmount",
  "fix_hint": "Adjust the VAT breakdown at `/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'L'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']` so that For each different value of VAT category rate (BT-119) where the VAT category code (BT-118) is \"IGIC\", the VAT category taxable amount (BT-116) in a VAT breakdown (BG-23) shall equal the sum of Invoice line net amounts (BT-131) plus the sum of document level charge amounts (BT-99) minus the sum of document level allowance amounts (BT-92) where the VAT category code (BT-151, BT-102, BT-95) is \"IGIC\" and the VAT rate (BT-152, BT-103, BT-96) equals the VAT category rate (BT-119).",
  "location": "/ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'L'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']",
  "message": "For each different value of VAT category rate (BT-119=25) where the VAT category code (BT-118) is 'IGIC', the VAT category taxable amount (BT-116=200) in a VAT breakdown (BG-23) shall equal the sum of Invoice line net amounts plus document level charges minus document level allowances at that IGIC rate.",
  "rule": "BR-AF-08",
  "severity": "fatal",
  "terms": [
    "BG-23",
    "BT-92",
    "BT-95",
    "BT-96",
    "BT-99",
    "BT-102",
    "BT-103",
    "BT-116",
    "BT-118",
    "BT-119",
    "BT-131",
    "BT-151",
    "BT-152"
  ],
  "title": "For each different value of VAT category rate (BT-119) where the VAT category code (BT-118) is 'IGIC', the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) plus document level charge amounts (BT-99) minus document level allowance amounts (BT-92) where the VAT category code is 'IGIC' and the VAT rate equals BT-119."
}

Rule ids reported for the failing document: BR-01 BR-02 BR-03 BR-04 BR-05 BR-06 BR-07 BR-08 BR-10 BR-21 BR-22 BR-23 BR-25 BR-26 BR-27 BR-46 BR-AF-02 BR-AF-08 BR-AF-09 BR-CO-14 BR-CO-17. For the corrected document: BR-01 BR-02 BR-03 BR-04 BR-05 BR-06 BR-07 BR-08 BR-10 BR-21 BR-22 BR-23 BR-25 BR-26 BR-27 BR-46 BR-AF-02 BR-AF-09 BR-CO-14 BR-CO-17.

Read that pair of lists honestly. A unit case is not a complete invoice: the upstream suite strips the document down to the elements this rule reads, so the engine also reports every mandatory element the fragment leaves out — 20 other rule ids here. Those are noise for this page. The signal is the difference: BR-AF-08 is reported for the failing document and gone for the corrected one, and it is the only id that moves.

Reproduce it yourself: save the failing block as invoice.xml and run einvoice validate invoice.xml --profile en16931 --format json, or paste it into the browser validator, which runs this same engine locally with no upload. Then apply the edit the passing block shows and run it again.

Everything here is free and open source — pick up whatever helps, at your own pace: