Attestwire › Rule reference › BR-31

BR-31 Every document-level allowance must have an amount

noun · EN 16931 · fatal · BT-92

For a sample invoice, the library reports: The document level allowance at allowances[0] has no usable allowance amount (BT-92): you supplied missing.

Business term
BT-92
Severity
fatal

The fix

Set allowances[0].amount to a positive number of EUR — always positive, even for an allowance: it is the array the entry sits in, not its sign, that decides whether the figure is deducted or added.

A passing value

the shape this field expects
"allowances": [{ "amount": 25.00, "vatCategory": "S", "vatRate": 19, "reason": "Volume discount" }]

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-31",
  "field": "BT-92",
  "severity": "fatal",
  "message": "The document level allowance at allowances[0] has no usable allowance amount (BT-92): you supplied missing. Each BG-20 group must have one, because it is the only figure that actually moves money — the percentage (BT-94) and base amount (BT-93) are documentation of how the figure was reached, not substitutes for it, and BT-107 is the sum of these amounts under BR-CO-11.",
  "fix": "Set allowances[0].amount to a positive number of EUR — always positive, even for an allowance: it is the array the entry sits in, not its sign, that decides whether the figure is deducted or added.",
  "example": "\"allowances\": [{ \"amount\": 25.00, \"vatCategory\": \"S\", \"vatRate\": 19, \"reason\": \"Volume discount\" }]",
  "xpath": "/ubl:Invoice/cac:AllowanceCharge[1]/cbc:Amount",
  "docsUrl": "https://attestwire.com/rules/BR-31"
}

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