← All guides · EN 16931 & validation
Invoice totals and the BR-CO rules: how e-invoice arithmetic must reconcile
By the Ingenious AI team · Published 14 November 2026 · Reviewed 14 November 2026
Convert an invoice free
Put this guide into practice now: convert one invoice free — validated UBL 2.1 XML plus a Factur-X PDF, with the acceptance checker for your client’s country. See pricing for bulk conversion, country rule packs and monitored clients.
Short answer
An e-invoice's totals are not typed; they are derived. Line extensions (quantity × unit price) sum to the line total; the tax breakdown groups taxable amounts by VAT category and rate; allowances and charges adjust the tax-exclusive amount; tax is added and prepaid amounts subtracted to reach the payable amount. The BR-CO rules (BR-CO-13, 14, 15) compare stated totals against this computation — any mismatch is a validation error.
What are the BR-CO rules?
The BR-CO rules are EN 16931's arithmetic consistency rules. In this product's engine, compute_totals derives every figure from the lines, and validation compares supplied totals against the computed ones: 'for key, rule in ((tax_exclusive, BR-CO-13), (tax_total, BR-CO-14), (payable, BR-CO-15))' — a mismatch returns an error naming the rule, the computed figure and the supplied figure. Rounding is to two decimals, half-up, per the engine's q2 function.
Step one: line extensions and the line total
Every total begins at the lines. Each line's extension is its quantity multiplied by its net unit price, rounded to cents (two decimals, half-up). The line total is the sum of those extensions — nothing else enters at this stage: no tax, no discounts, no adjustments. If a line's quantity or price is wrong, every figure downstream inherits the error, which is why line discipline (one item, one treatment, real quantities) is arithmetic hygiene and not pedantry.
Rounding deserves respect: it happens per line extension, at two decimals, before summing. Two systems computing the same invoice agree because they round at the same points in the same way. Hand-built spreadsheets drift precisely here — rounding at different stages, or not at all until the end — and produce the one-cent mismatches that BR-CO comparisons reject with complete indifference to how small they are.
Step two: the tax breakdown by category and rate
The engine groups line extensions by their VAT category and rate pair: all S-at-20% lines form one taxable amount, all AE-at-0% lines another. For taxed categories, the tax on each group is the taxable amount times the rate. For the categories E, AE, O and Z, the tax is zero by construction — the category itself declares that no tax is charged on that group, whatever the taxable amount.
The breakdown is not a summary for humans; it is the invoice's tax evidence, booked by the client's system category by category. It is also why mixed invoices must keep treatments on separate lines: the breakdown can only group what the lines declare. A blended line has no correct group to join, so its tax would be computed at a fiction — the breakdown's integrity is the lines' integrity, restated.
Step three: allowances, charges and the tax-exclusive amount
Document-level allowances (discounts applying to the invoice as a whole) reduce, and document-level charges (delivery, handling and the like) increase, the amount the tax is settled against. The engine's tax-exclusive amount is the line total minus the allowance total plus the charge total, each rounded to cents. Line-level pricing stays clean because the document-level adjustments live in their own fields — visible to the arithmetic and to the auditor alike.
A subtlety the code states honestly: document allowances complicate per-category tax, because an allowance spread across categories changes each group's taxable base. Practical invoicing avoids the swamp by putting discounts where they belong — as line-level prices for specific items, or as document allowances whose tax handling your accountant confirms — rather than as after-the-fact adjustments to a total. The BR-CO rules will reconcile whatever structure you choose; they cannot choose a sensible structure for you.
Step four: tax total, prepaid and the payable amount
The tax total is the sum of the breakdown's per-group tax amounts. The payable amount — the figure the client must actually pay — is the tax-exclusive amount plus the tax total, minus any amount already prepaid. That last term is the one PDF-era invoices handle worst: deposits and part-payments vanish into covering emails, and the 'balance due' is typed from memory. In the structured model, prepaid is a field, the subtraction is mechanical, and the payable amount is provably the residue of the whole computation.
BR-CO-15 then guards the result: if a supplied payable amount differs from the computed one by a cent, the invoice fails. This is not cruelty — the payable amount is the single figure money moves on, and two versions of it (stated vs computed) is precisely the ambiguity structured invoicing exists to abolish. One computation, one figure, every system in agreement.
Living with derived totals
The working rule that follows from all of this: never type a total again. Enter lines, allowances, charges and prepaid amounts — the facts — and let the engine derive every sum. If a client or a legacy system supplies expected totals, the validator compares them (that is the expected_totals check doing its job) and any mismatch opens a conversation about facts: a line missing, a price stale, a discount misplaced. The mismatch is the message; shoot the habit, not the messenger.
Firms feel the benefit at reconciliation time. When every invoice's totals are derived by the same computation, the books, the client's bookings and the bank movements reconcile as a matter of course, and the exceptions that remain are real business events — short payments, credits, disputes — rather than arithmetic weather. The BR-CO rules are three lines in a validator and, quietly, the end of the spreadsheet era of invoicing.
Totals discipline in 5 steps
- Enter only facts: quantities, unit prices, categories, rates, allowances, charges, prepaid amounts.
- Check the tax breakdown per category-rate pair against your lines before submitting anything anywhere.
- Put discounts in allowance fields and surcharges in charge fields — never inside totals or unit prices silently.
- Record prepaid amounts as a field so the payable amount is the computed residue, not a remembered balance.
- If a BR-CO error appears, hunt the factual cause (missing line, stale price, misplaced discount) — never adjust the total to match.
Worked example: a full computation, cent by cent
An invoice has two lines: 3 days of consulting at EUR 750.00 (EUR 2,250.00) and 2 days of training at EUR 600.00 (EUR 1,200.00), both category S at 20%. Line total: EUR 3,450.00. A document allowance of EUR 150.00 and a charge of EUR 30.00 give a tax-exclusive amount of EUR 3,330.00. The tax breakdown's single group (S, 20%) computes tax on its taxable base; the engine derives the tax total, and with EUR 500.00 prepaid recorded, the payable amount is the tax-exclusive figure plus tax, minus EUR 500.00.
Change any fact — a fourth consulting day, a larger allowance — and every figure after it moves by derivation, staying mutually consistent. Type the payable by hand instead, and the first edit orphans it: BR-CO-15 fires, naming computed and supplied side by side, which is the validator doing arithmetic's oldest job — refusing to let two truths share one document.
Frequently asked questions
What are BR-CO-13, 14 and 15?
The comparisons between supplied and computed totals: BR-CO-13 for the tax-exclusive amount, BR-CO-14 for the tax total, BR-CO-15 for the payable amount. A mismatch on any of them is a validation error.
How is rounding handled?
Line extensions are rounded to two decimals (half-up) before summing, and totals are carried at two decimals — the same points every time, so independent systems agree to the cent.
Where do discounts go?
In the allowance fields — line-level pricing for item-specific discounts, document allowance for whole-invoice ones. Never netted silently into a typed total.
How are prepaid amounts handled?
As a field in the computation: payable = tax-exclusive + tax total − prepaid. The deposit stops living in a covering email and becomes part of the invoice's arithmetic.
My spreadsheet total differs by one cent — who is right?
The derived computation, because it rounds per line extension at defined points. A one-cent drift means your spreadsheet rounds elsewhere; align it to the line-level method or let the converter compute.
Keep going
Run the free tool this guide is about: convert an invoice · acceptance checker · pricing · about EInvoice Translator · all guides
Related guides
- EN 16931 business rules explained: what BR codes mean when validation fails
- Allowances, charges and prepaid amounts on an e-invoice, explained
- VAT categories explained: S, Z, E, AE, K, G and O on an e-invoice line
- How to validate an e-invoice before you send it (and read the errors)
- My e-invoice was rejected: how to read the error and fix the real cause