Calculation and cross-field rules — when the totals do not add up

BR-CO does not check individual fields but how they relate: that the totals reconcile, that two entries do not contradict each other, that a value matches the values it is derived from.

23 rules · 19 explained · Rule set v2026-08-31

Rounding is the usual cause

The total rules — BR-CO-10 through BR-CO-17 — rarely fail because somebody calculated wrongly. They fail because of when the rounding happened. Keep line amounts internally at four decimal places, round them to two only when writing the XML, and build the total from the unrounded values, and you produce an invoice whose lines do not add up to its own total.

The norm requires the other order: round first, then sum. That is one line in the mapping and the difference between an accepted and a rejected invoice.

How exact the arithmetic has to be is not the same across the family. BR-CO-10, BR-CO-13, BR-CO-14, BR-CO-15 and BR-CO-16 compare to the cent — one cent out and the rule reports. BR-CO-17 compares with “greater than minus one” and “less than plus one”, which leaves a whole currency unit of slack. Reproduced against the running validator on 17 September 2026: one cent too much in a category tax amount reports BR-CO-14 alone, a full euro reports BR-CO-14, BR-CO-17 and BR-S-09. Which rules fire together therefore tells you how far out you are.

Entries that exclude each other

The other half of the family checks pairs where exactly one may be set: the tax point as a date (BT-7) or as a code (BT-8), never both. Systems that fill both fields “to be safe” breach these for exactly that reason.

No amount of recalculating helps here; a decision in the mapping does. Which of the two is the source, and the other stays empty.

Four rules in the family require something nothing enforces. BR-CO-05 through BR-CO-08 ask that an allowance or charge reason in plain text and its code mean the same thing — and whether a code and a sentence mean the same thing is not something Schematron can decide. The compiled test reads true() in both syntaxes. The requirement is in the norm and is never reported: a wrongly chosen code passes the validator and is caught only by the person who reads the invoice.

All calculation and cross-field rules

With the official rule text. Rules with a written explanation carry their cause and fix directly beneath.

NormAPI provides technical validation, not tax or legal advice.