BR-DEX-02: Line net amount does not match the sum of its sub invoice lines
Official message
[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.
- Severity
- Warning Note: this does not make the invoice invalid, but it should be checked.
- Applies to
- XRechnung (UBL)
- Affected fields
- BT-131, BG-25, BG-DEX-01
What does this mean?
In an XRechnung extension invoice (UBL), the net amount (Invoice line net amount, BT-131) of an invoice line (BG-25) or sub invoice line (BG-DEX-01) should equal the sum of the net amounts of the sub invoice lines directly below it. For at least one line the sum does not match. The message is a warning.
Typical causes
A sub invoice line was changed, added or removed without adjusting the amount of the parent line.
Rounding differences: the parent line was calculated from unrounded values, the sub lines from rounded ones.
Amounts were summed across several levels instead of only the sub lines directly below.
How to fix the error
Calculate the net amount of every line with sub lines as the sum of the net amounts of the sub lines directly below it (cac:SubInvoiceLine/cbc:LineExtensionAmount).
With several levels, repeat the check from the bottom up.
Generate and validate the invoice again.
Example
Wrong
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:LineExtensionAmount currencyID="EUR">300.00</cbc:LineExtensionAmount>
<cac:SubInvoiceLine>
<cbc:ID>1.1</cbc:ID>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
...
</cac:SubInvoiceLine>
<cac:SubInvoiceLine>
<cbc:ID>1.2</cbc:ID>
<cbc:LineExtensionAmount currencyID="EUR">150.00</cbc:LineExtensionAmount>
...
</cac:SubInvoiceLine>
...
</cac:InvoiceLine>
Correct
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:LineExtensionAmount currencyID="EUR">250.00</cbc:LineExtensionAmount>
<cac:SubInvoiceLine>
<cbc:ID>1.1</cbc:ID>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
...
</cac:SubInvoiceLine>
<cac:SubInvoiceLine>
<cbc:ID>1.2</cbc:ID>
<cbc:LineExtensionAmount currencyID="EUR">150.00</cbc:LineExtensionAmount>
...
</cac:SubInvoiceLine>
...
</cac:InvoiceLine>
For developers: test expression per syntax
XRechnung (UBL) (UBL)
Context: /ubl:Invoice[$isExtension]
(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]))
Related validation rules
- BR-DEX-01: Invalid MIME code of an attachment (BT-125) in the XRechnung extension
- BR-DEX-03: Sub invoice line without exactly one VAT information (BG-DEX-06)
- BR-DEX-04: Scheme of a party identifier is not an ISO 6523 ICD code (extension)
- BR-DEX-05: Scheme of a registration identifier is not an ISO 6523 ICD code (extension)
- BR-DEX-06: Scheme of the item standard identifier (BT-157) is not an ISO 6523 ICD code (extension)
- BR-DEX-07: Scheme of the electronic address is not an EAS code (extension)
Last updated:
Explanation of the validation rule, not legal or tax advice.