BR-DEX – XRechnung extension
BR-DEX-02: line amount differs from the sum of its sub invoice lines
WarningXRechnung business rule (KoSIT)
The rule's own wording
[BR-DEX-02] Der Wert von "Invoice line net amount" (BT-131) einer "INVOICE LINE" (BG-25) oder einer "SUB INVOICE LINE" (BG-DEX-01) soll der Summe der "Invoice line net amount" (BT-131) der direkt darunterliegenden "SUB INVOICE LINE" (BG-DEX-01) entsprechen.Source: KoSIT XRechnung, version 3.0.2 (Schematron 2.6.0)
The fix in the XML
Calculate cbc:LineExtensionAmount of the line as the sum of the LineExtensionAmount of its direct cac:SubInvoiceLine elements, rounded to two decimals, and spread discounts over the sub lines so that both levels give the same result.
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">300.00</cbc:LineExtensionAmount>
<cac:SubInvoiceLine>
<cbc:ID>1.1</cbc:ID>
<cbc:LineExtensionAmount currencyID="EUR">200.00</cbc:LineExtensionAmount>
</cac:SubInvoiceLine>
<cac:SubInvoiceLine>
<cbc:ID>1.2</cbc:ID>
<cbc:LineExtensionAmount currencyID="EUR">50.00</cbc:LineExtensionAmount>
</cac:SubInvoiceLine>
</cac:InvoiceLine><cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="C62">1</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">250.00</cbc:LineExtensionAmount>
<cac:SubInvoiceLine>
<cbc:ID>1.1</cbc:ID>
<cbc:LineExtensionAmount currencyID="EUR">200.00</cbc:LineExtensionAmount>
</cac:SubInvoiceLine>
<cac:SubInvoiceLine>
<cbc:ID>1.2</cbc:ID>
<cbc:LineExtensionAmount currencyID="EUR">50.00</cbc:LineExtensionAmount>
</cac:SubInvoiceLine>
</cac:InvoiceLine>Meaning of the rule
Your invoice uses sub invoice lines, which exist only in the XRechnung extension: a line is split into several sub lines, for example a package into its components. The net amount of the parent line should equal the sum of the net amounts of its direct sub lines. If it differs, XRechnung reports the difference, because the recipient does not know which amount applies. Usually the line was changed after the sub lines were created, or one is missing.
What usually goes wrong
- The amount of the main line was changed but the sub lines were not adjusted.
- A sub line was deleted without recalculating the sum.
- Discounts were deducted only on the main line, not in the sub lines.
Questions and answers
Do sub invoice lines exist in CII as well?
The XRechnung extension defines sub lines for UBL only; CII lacks the structure, so BR-DEX-02 applies to UBL invoices only.
May a sub line have sub lines itself?
Yes, nesting is allowed. The rule checks on every level only the directly subordinate lines.
EN 16931 fields
- BT-131
- BG-25
See also
Check your invoice
The XRechnung validator reports this rule with the line number and location – right in your browser, without upload.
The rule in detail
- UBL · Context (XPath)
/ubl:Invoice[$isExtension]- UBL · Schematron test
(every $invoiceline in /ubl:Invoice/cac:InvoiceLine[ exists (./cac:SubInvoiceLine) ] satisfies $invoiceline/xs:decimal(cbc:LineExtensionAmount) = sum($invoiceline/cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))) and (count( //cac:SubInvoiceLine [count(cac:SubInvoiceLine) > 0 and xs:decimal(cbc:LineExtensionAmount) = sum(cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))]) = count(//cac:SubInvoiceLine [count(cac:SubInvoiceLine) > 0]))
Explanation written on 14 September 2026