Rule reference

BR-24 A line (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

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.

This rule is implemented and its error payload below is real, but the long-form write-up — normative text, worked example, divergence note — is not written yet. Everything the library knows about this rule is on this page. Ask and we will prioritise it.

Business term
BT-131
Severity
fatal

What the library returns

The exact object in result.errors when this rule fires. Generated by running @attestwire/en16931, not transcribed:

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 locates the element in the generated UBL document, which is where a KoSIT or Peppol validator will report the same problem.

A passing value

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

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.

Arrived from a stack trace? The docsUrl on every error links straight here. Something wrong on this page — tell us.