SchemaGuard by Ironbark Digital · EN 16931 / Peppol / XRechnung Reference
← All 294 EN 16931 / Peppol Rules & Live Validator
FATAL Official EN 16931 / Peppol / CIUS Rule BT/BG Fields: BT-108

BR-DEC-11 — E-Invoice Validation Rule & Fix

Fixture ID: declaredAllowanceTotalsOverPrecise · XPath: /ubl:Invoice/cac:LegalMonetaryTotal/cbc:ChargeTotalAmount

1. Why This Rule Triggers (Diagnostic Message)

The allowed maximum number of decimals for the Sum of charges on document level (BT-108) is 2, but you declared 5.005, which has 3. The rule is written against the serialised value — the schematron counts the characters after the decimal point in the XML — so the check is about what gets written, not about what the number "really" is. Charges are the usual home of per-unit and percentage-based figures — freight per kilo, a 1.5% handling fee — so this is the total most likely to inherit a long decimal from the arithmetic that produced it.

2. How to Fix BR-DEC-11

Round declaredTotals.chargeTotalAmount to two decimals (5.01 here) using half-up rounding away from zero, for which this package exports round2(). Alternatively drop declaredTotals and let the library compute the totals, which it always rounds correctly.

3. Valid Code / Payload Example

"declaredTotals": { "chargeTotalAmount": 5.01 }
Test & Validate XML / JSON in Live SchemaGuard Validator →