Attestwire › Rule reference › BR-CO-11
BR-CO-11 The allowance total must equal the sum of document-level allowances
noun · EN 16931 · fatal · BT-107
For a sample invoice, the library reports: BR-CO-11 requires BT-107 to equal Σ BT-92, the sum of the BG-20 amounts on the document. You declared 1.00 for BT-107, but the single entry in allowances sum to 10.00 — a difference of -9.00 EUR.
- Business term
BT-107- Severity
fatal
The fix
Either correct the allowances array so it sums to your declared figure, or drop declaredTotals.allowanceTotalAmount and let the library compute it — generation always emits the computed value regardless of what you declare. Sum the *rounded* entry amounts, in that order: EN 16931 rounds each amount to two decimals and then adds.
A passing value
"declaredTotals": { "allowanceTotalAmount": 10.00 }What the library returns
The full error returned by @attestwire/en16931. It includes the rule ID,
affected field and suggested correction. Developers can use this object in their application:
{
"rule": "BR-CO-11",
"field": "BT-107",
"severity": "fatal",
"message": "BR-CO-11 requires BT-107 to equal Σ BT-92, the sum of the BG-20 amounts on the document. You declared 1.00 for BT-107, but the single entry in allowances sum to 10.00 — a difference of -9.00 EUR. BT-107 is a plain sum and nothing nets against it: a document level charge in the same VAT category does reduce the taxable amount of that category's breakdown group, but it never reduces BT-107, which stays a gross disclosure of everything deducted.",
"fix": "Either correct the allowances array so it sums to your declared figure, or drop declaredTotals.allowanceTotalAmount and let the library compute it — generation always emits the computed value regardless of what you declare. Sum the *rounded* entry amounts, in that order: EN 16931 rounds each amount to two decimals and then adds.",
"example": "\"declaredTotals\": { \"allowanceTotalAmount\": 10.00 }",
"xpath": "/ubl:Invoice/cac:LegalMonetaryTotal/cbc:AllowanceTotalAmount",
"docsUrl": "https://attestwire.com/rules/BR-CO-11"
}
xpath is always a UBL path. On a CII invoice, look for the
matching CII field instead.