AttestwireRule referenceBR-24

BR-24 Every invoice line must have a line net amount

noun · EN 16931 · fatal · BT-131

For a sample invoice, the library reports: Line 1 (id "1") has no invoice line net amount (BT-131), because the item price base quantity (BT-149) is 0, and dividing by it is undefined.

Business term
BT-131
Severity
fatal

The fix

Set line.baseQuantity to the number of units the price refers to, and never to zero. Use 1 (the default) when the price is per single unit; use 100 when you quote "€12.50 per 100 sheets" with quantity in sheets. Omit the field entirely if you are not pricing per bundle.

A passing value

the shape this field expects
"quantity": 500, "unitPrice": 12.5, "baseQuantity": 100

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-24",
  "field": "BT-131",
  "severity": "fatal",
  "message": "Line 1 (id \"1\") has no invoice line net amount (BT-131), because the item price base quantity (BT-149) is 0, and dividing by it is undefined. BT-131 is not an input in this model — it is derived as invoiced quantity (BT-129) x item net price (BT-146) / item price base quantity (BT-149) — so a factor that makes the division impossible removes the line amount, and with it the document totals and the whole VAT breakdown.",
  "fix": "Set line.baseQuantity to the number of units the price refers to, and never to zero. Use 1 (the default) when the price is per single unit; use 100 when you quote \"€12.50 per 100 sheets\" with quantity in sheets. Omit the field entirely if you are not pricing per bundle.",
  "example": "\"quantity\": 500, \"unitPrice\": 12.5, \"baseQuantity\": 100",
  "xpath": "/ubl:Invoice/cac:InvoiceLine[1]/cbc:LineExtensionAmount",
  "docsUrl": "https://attestwire.com/rules/BR-24"
}

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