BR-DEX-02: XRechnung Extension rule BR-DEX-02

BR-DEX-02 belongs to the XRechnung Extension, which adds sub-invoice lines (BG-DEX-01), third-party payments (BG-DEX-09) and wider identifier lists to XRechnung; it applies only to a document whose specification identifier (BT-24) declares the extension. Below: the message, the cause and the fix.

The message validators print

BR-DEX-02 is a rule of the XRechnung 3.0 rules (xrechnung-schematron 2.6.0 (XRechnung 3.0.2)) for UBL. It is a warning: the invoice stays valid, but should be corrected.

UBL
[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.

What it checks

BR-DEX-02 belongs to the XRechnung Extension, which adds sub-invoice lines (BG-DEX-01), third-party payments (BG-DEX-09) and wider identifier lists to XRechnung; it applies only to a document whose specification identifier (BT-24) declares the extension. Its published text: « 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. »

Why invoices fail it

A document declares the extension identifier without using the extension’s structures as specified, or uses them in a plain XRechnung.

How to fix it

Follow the XRechnung Extension specification of KoSIT for the structure named in the message, or use the plain XRechnung identifier when no extension element is needed.

This explanation covers the whole BR-DEX family (15 rules, overview), so this page is not indexed.

The rule as published

Where the rule applies (context) and what must hold (test), unmodified from XRechnung 3.0.2 schematron 2.6.0. An assert fails when its test is false.

Text and test: © KoSIT, Apache License 2.0. Quoted unmodified; the explanations on this page are Veriport’s.

UBL · XRechnung 3.0.2 schematron (UBL) 2.6.0 · assert · warning
context: /ubl:Invoice[$isExtension]
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]))

Check your own invoice

Drop your XRechnung, ZUGFeRD or Peppol file into a free validator (Peppol BIS, XRechnung, Factur-X): each runs the same rule files and links every finding to its rule page. From your own code, POST /einvoice/validate (reference) returns the same check as JSON, each finding with an explanation field pointing here (5 calls a check, anonymous within the daily allowance).

Sources