einvoice / EN 16931 / XRechnung rule reference

BR-DEC-23

What this rule means and how to fix it

Max 2 decimals for the Invoice line net amount (BT-131).

Die zulässige Höchstzahl an Nachkommastellen für „Nettobetrag der Rechnungsposition“ (BT-131) beträgt 2.

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

Requires
The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.
Business terms
BT-131
Syntax
Binds the UBL-2.1 Invoice / CreditNote syntax and the UN/CEFACT-CII syntax
Location (UBL-2.1 path)
cac:InvoiceLine
Fix
Round the value at `cac:InvoiceLine` to the allowed number of decimals: The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.
Fix (Deutsch)
Runden Sie den Wert bei `cac:InvoiceLine` auf die zulässige Anzahl an Nachkommastellen: Die zulässige Höchstzahl an Nachkommastellen für „Nettobetrag der Rechnungsposition“ (BT-131) beträgt 2.
Severity
fatal
Provenance source
xrechnung-ubl
Provenance assert

The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.

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 UN/CEFACT-CII 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-DEC-23 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-DEC-23 nicht mehr, sobald die Korrektur greift.

The same invoice, failing and fixed

No vendored test suite ships a labelled example for this rule, so this pair was found rather than written. The engine was run over the vendored instance corpus/xrechnung-testsuite/src/test/technical-cases/cius/01.06_minimal_test_ubl.xml under --profile xrechnung, then re-run over the same file with one mechanical edit applied to one element, over and over, until the edit below changed the verdict: a third decimal place was added to LineExtensionAmount (3986.34 became 3986.341). The page publishes it because the engine reported BR-DEC-23 for the edited document and did not report it for the untouched one.

UBL Invoice — fails

The vendored file around the change, verbatim:

<cac:InvoiceLine>
  <cbc:ID>1</cbc:ID>
  <cbc:InvoicedQuantity unitCode="XPP">30</cbc:InvoicedQuantity>
  <cbc:LineExtensionAmount currencyID="EUR">3986.341</cbc:LineExtensionAmount>
  <cac:Item>
    <cbc:Name>Beratung</cbc:Name>
    <cac:ClassifiedTaxCategory>
      <cbc:ID>S</cbc:ID>
      <cbc:Percent>19</cbc:Percent>
      <cac:TaxScheme>
        <cbc:ID>VAT</cbc:ID>
      </cac:TaxScheme>
    </cac:ClassifiedTaxCategory>
  </cac:Item>
  <cac:Price>
    <cbc:PriceAmount currencyID="EUR">132.878</cbc:PriceAmount>
  </cac:Price>
</cac:InvoiceLine>

UBL Invoice — passes

The same lines as 01.06_minimal_test_ubl.xml actually ships them — this block is the fix for the block above:

<cac:InvoiceLine>
  <cbc:ID>1</cbc:ID>
  <cbc:InvoicedQuantity unitCode="XPP">30</cbc:InvoicedQuantity>
  <cbc:LineExtensionAmount currencyID="EUR">3986.34</cbc:LineExtensionAmount>
  <cac:Item>
    <cbc:Name>Beratung</cbc:Name>
    <cac:ClassifiedTaxCategory>
      <cbc:ID>S</cbc:ID>
      <cbc:Percent>19</cbc:Percent>
      <cac:TaxScheme>
        <cbc:ID>VAT</cbc:ID>
      </cac:TaxScheme>
    </cac:ClassifiedTaxCategory>
  </cac:Item>
  <cac:Price>
    <cbc:PriceAmount currencyID="EUR">132.878</cbc:PriceAmount>
  </cac:Price>
</cac:InvoiceLine>

What the engine reports for the edited invoice

{
  "element": "cac:InvoiceLine[1] id='1'/cbc:LineExtensionAmount",
  "field": "cac:InvoiceLine[1] id='1'/cbc:LineExtensionAmount",
  "fix_hint": "Round the value at `cac:InvoiceLine` to the allowed number of decimals: The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.",
  "location": "cac:InvoiceLine",
  "message": "The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.",
  "rule": "BR-DEC-23",
  "severity": "fatal",
  "terms": [
    "BT-131"
  ],
  "title": "Max 2 decimals for the Invoice line net amount (BT-131)."
}

Rule ids the engine reports for 01.06_minimal_test_ubl.xml untouched: BR-DE-TMP-32. After the edit, BR-DEC-23 is reported that was not before.

Two honest limits. This is an edit that provokes the rule, not the only one, and it is not a claim about how real exporters break it. And it is the reverse of the fix a reader needs: the passing block is the vendored file's own content, which is what a conformant invoice looks like here.

Reproduce it yourself: take corpus/xrechnung-testsuite/src/test/technical-cases/cius/01.06_minimal_test_ubl.xml from this repository, apply the one edit named above, and run einvoice validate 01.06_minimal_test_ubl.xml --profile xrechnung --format json, or paste the file into the browser validator, which runs this same engine locally with no upload.

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