AttestwireRule referenceBR-33

BR-33 Every document-level allowance must state a reason or reason code

noun · EN 16931 · fatal · BT-97 / BT-98

For a sample invoice, the library reports: The document level allowance at allowances[0] states neither a reason (BT-97) nor a reason code (BT-98); both are empty.

Business term
BT-97 / BT-98
Severity
fatal

The fix

Set allowances[0].reason to a short description in the invoice language, or allowances[0].reasonCode to a UNCL 5189 code, or both. Under XRechnung, prefer the free text: the mandated visualisation renders the code verbatim, so a buyer looking at the rendered invoice sees the bare code and not what it means.

A passing value

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

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-33",
  "field": [
    "BT-97",
    "BT-98"
  ],
  "severity": "fatal",
  "message": "The document level allowance at allowances[0] states neither a reason (BT-97) nor a reason code (BT-98); both are empty. Every BG-20 group must carry at least one of them, because an unexplained deduction from an invoice total is the single most disputed thing on a commercial document — the buyer's accounts-payable clerk has to decide whether to approve it, and \"−missing\" on its own gives them nothing to decide on.",
  "fix": "Set allowances[0].reason to a short description in the invoice language, or allowances[0].reasonCode to a UNCL 5189 code, or both. Under XRechnung, prefer the free text: the mandated visualisation renders the code verbatim, so a buyer looking at the rendered invoice sees the bare code and not what it means.",
  "example": "\"allowances\": [{ \"amount\": 25.00, \"vatCategory\": \"S\", \"vatRate\": 19, \"reason\": \"Discount\", \"reasonCode\": \"95\" }]",
  "xpath": "/ubl:Invoice/cac:AllowanceCharge[1]/cbc:AllowanceChargeReason",
  "docsUrl": "https://attestwire.com/rules/BR-33"
}

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