# BR-CO-10: Fix a line total that does not match the sum of the lines

The sum of line net amounts in the monetary totals must equal the line net amounts added together, rounded to two decimals.

- Layer: EN 16931
- Severity: fatal (the document is invalid)
- Topics: Totals, Lines and prices
- Official definition: https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/BR-CO-10/
- Explanation last updated: 2026-09-20

## The short answer

`BR-CO-10` fails when `cac:LegalMonetaryTotal/cbc:LineExtensionAmount` is not the sum of the line net amounts. Add up `cbc:LineExtensionAmount` from every `cac:InvoiceLine` (or `cac:CreditNoteLine`), round the sum to two decimals, and write that figure in the monetary totals.

Correct the total, not the lines, unless a line really is wrong. Every later total is built on this one, so expect `BR-CO-13` beside it until the figure is right.

## What the rule checks

The rule reads two things: the `cbc:LineExtensionAmount` inside `cac:LegalMonetaryTotal`, and the `cbc:LineExtensionAmount` of every line in the document. Lines with a negative net amount count with their sign.

Document-level allowances and charges play no part. They belong to the allowance total and the charge total, not to this sum. Line-level allowances and charges are not added separately either, because each line net amount already includes them.

The sum of the lines is rounded to two decimals and then compared exactly. There is no tolerance: a total of 66.01 against lines adding up to 66.00 fails.

| Term | Meaning | UBL element |
|---|---|---|
| BT-106 | Sum of Invoice line net amount | `cac:LegalMonetaryTotal/cbc:LineExtensionAmount` |
| BT-131 | Invoice line net amount | `cac:InvoiceLine/cbc:LineExtensionAmount (cac:CreditNoteLine/cbc:LineExtensionAmount in a credit note)` |

## How an integration ends up here

Possible causes, from the shape of the rule rather than from measured usage:

- The total comes from a stored order or ledger header while the lines are built from a separate table, and a line was filtered out, added or edited after the header was saved.
- Correction lines with negative amounts are skipped, or added as absolute values, when the total is computed.
- The total is calculated from unrounded quantity times price and rounded once, while each line net amount is rounded to two decimals before it is written.
- A document-level discount or charge is netted into the line total as well as being sent as a `cac:AllowanceCharge`.
- Amounts are summed as binary floating point and the result is a penny out once formatted.

## How to fix it

1. Take the `cbc:LineExtensionAmount` of every line exactly as it will appear in the XML, already rounded to two decimals.
2. Sum those values with decimal arithmetic, keeping the sign of negative lines, and round the result to two decimals.
3. Write the result to `cac:LegalMonetaryTotal/cbc:LineExtensionAmount`.
4. Recalculate the total without VAT from the corrected figure: line total minus allowance total plus charge total. `BR-CO-13` checks that next.

The recorded example has three lines, one of them a negative correction.

```text
Line net amounts: 58.00 + 10.00 + (-2.00) = 66.00
Line total sent (BT-106): 67.00, so BR-CO-10 fails
Total without VAT sent: 68.50, which is 66.00 - 1.00 + 3.50
Against the 67.00 that was sent, BR-CO-13 expects 67.00 - 1.00 + 3.50 = 69.50, so it fails too
```

## Before and after

These are fragments, not complete documents. The complete synthetic documents they come from are linked below.

Fragment of the failing invoice: the total says 67.00, the lines add up to 66.00

```xml
<cac:LegalMonetaryTotal>
  <cbc:LineExtensionAmount currencyID="GBP">67.00</cbc:LineExtensionAmount>
  <cbc:TaxExclusiveAmount currencyID="GBP">68.50</cbc:TaxExclusiveAmount>
  <!-- remaining totals omitted from this fragment -->
</cac:LegalMonetaryTotal>

<cac:InvoiceLine>
  <cbc:ID>1</cbc:ID>
  <!-- note and quantity omitted from this fragment -->
  <cbc:LineExtensionAmount currencyID="GBP">58.00</cbc:LineExtensionAmount>
  <!-- accounting cost, order line reference, line allowance and charge, item and price omitted from this fragment -->
</cac:InvoiceLine>
<cac:InvoiceLine>
  <cbc:ID>2</cbc:ID>
  <!-- quantity omitted from this fragment -->
  <cbc:LineExtensionAmount currencyID="GBP">10.00</cbc:LineExtensionAmount>
  <!-- item and price omitted from this fragment -->
</cac:InvoiceLine>
<cac:InvoiceLine>
  <cbc:ID>3</cbc:ID>
  <!-- quantity omitted from this fragment -->
  <cbc:LineExtensionAmount currencyID="GBP">-2.00</cbc:LineExtensionAmount>
  <!-- item and price omitted from this fragment -->
</cac:InvoiceLine>
```

Fragment of the corrected invoice: the total is the sum of the three lines

```xml
<cac:LegalMonetaryTotal>
  <cbc:LineExtensionAmount currencyID="GBP">66.00</cbc:LineExtensionAmount>
  <cbc:TaxExclusiveAmount currencyID="GBP">68.50</cbc:TaxExclusiveAmount>
  <!-- remaining totals omitted from this fragment -->
</cac:LegalMonetaryTotal>
```

Only the `cbc:LineExtensionAmount` inside `cac:LegalMonetaryTotal` differs; the lines are identical. The failing document also reports `BR-CO-13`, because the total without VAT of 68.50 was calculated from a line total of 66.00 and no longer agrees with the 67.00 that was sent. Correcting the line total clears both.

### What the validator reported

- The failing invoice reports **BR-CO-10** and [BR-CO-13](https://ironfang.uk/docs/finance/rules/BR-CO-13.md). The corrected document passes every layer with no findings.
  - [Download the failing XML](https://ironfang.uk/finance/rule-examples/BR-CO-10-invalid.xml)
  - [Download the corrected XML](https://ironfang.uk/finance/rule-examples/invoice-rich.xml)

Recorded on phive 12.1.0 / phive-rules-peppol 4.5.6 / Saxon-HE 12.10, the engine behind the free validator, using synthetic data. A recorded result is regression evidence for these documents; it is not a certification.

## Where it applies

- Applies to UBL `Invoice` and `CreditNote` alike. In a credit note the lines are `cac:CreditNoteLine`; the total has the same name and the same two findings appear.
- The rule does not check how a line net amount was calculated from quantity, price and line allowances. That is a separate Peppol check on each line.
- The rule compares the numbers only. It does not read `currencyID` and converts nothing.

## Related rules

- [BR-CO-13 builds the total without VAT from this line total](https://ironfang.uk/docs/finance/rules/BR-CO-13.md)
- [PEPPOL-EN16931-R120 checks each line net amount against its quantity, price, allowances and charges](https://ironfang.uk/docs/finance/rules/PEPPOL-EN16931-R120.md)
- [BR-DEC-23 limits each line net amount to two decimals](https://ironfang.uk/docs/finance/rules/BR-DEC-23.md)

## Scope and source

Written for Peppol BIS Billing 3.0.21 (May 2026), EN 16931 1.3.16, as applied to UBL 2.1 Invoice and CreditNote documents. Other profiles, syntaxes and releases can define this identifier differently. Guidance version 2026-09-20.1: source checked 2026-09-20, explanation last updated 2026-09-20.

[The official definition of BR-CO-10](https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/BR-CO-10/) carries the normative wording and test. This page is our explanation of it, not a copy.

Guidance does not change the engine verdict. Fixing this finding does not mean the document passes every layer, and validation does not certify legal or tax compliance or transmit a document over Peppol.

## Links

- [This rule as a web page](https://ironfang.uk/docs/finance/rules/BR-CO-10)
- [Free Peppol invoice validator](https://ironfang.uk/tools/peppol-validator)
- [Rule index](https://ironfang.uk/docs/finance/rules.md)
- [Ironfang Finance API docs](https://ironfang.uk/docs/finance)
- The same rule is available to MCP clients as the tool `finance.rule.get` on https://mcp.ironfang.uk/mcp
