AttestwireRule referenceBR-41

BR-41 Every line allowance must have an amount

noun · EN 16931 · fatal · BT-136

For a sample invoice, the library reports: The invoice line allowance at lines[0].allowances[0], on line 1 (id "1"), has no usable amount (BT-136): you supplied missing.

Business term
BT-136
Severity
fatal

The fix

Set lines[0].allowances[0].amount to a positive number. Line level entries have no VAT category of their own: they inherit the line's, which is why a line discount changes BT-131 rather than appearing in the VAT breakdown on its own account.

A passing value

the shape this field expects
"allowances": [{ "amount": 12.50, "reason": "Damaged goods" }]

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:

TeachingError
{
  "rule": "BR-41",
  "field": "BT-136",
  "severity": "fatal",
  "message": "The invoice line allowance at lines[0].allowances[0], on line 1 (id \"1\"), has no usable amount (BT-136): you supplied missing. Each BG-27 group must have one, and at line level the consequence is immediate — the line net amount is BT-129 x (BT-146 / BT-149) − Σ BT-136 + Σ BT-141, so an entry with no amount silently contributes nothing and the line total the buyer sees is not the one you meant to send.",
  "fix": "Set lines[0].allowances[0].amount to a positive number. Line level entries have no VAT category of their own: they inherit the line's, which is why a line discount changes BT-131 rather than appearing in the VAT breakdown on its own account.",
  "example": "\"allowances\": [{ \"amount\": 12.50, \"reason\": \"Damaged goods\" }]",
  "xpath": "/ubl:Invoice/cac:InvoiceLine[1]/cac:AllowanceCharge[1]/cbc:Amount",
  "docsUrl": "https://attestwire.com/rules/BR-41"
}

xpath is always a UBL path. On a CII invoice, look for the matching CII field instead.