AttestwireRule referencePEPPOL-EN16931-R120

PEPPOL-EN16931-R120 The line net amount must equal quantity × price, less allowances, plus charges

noun · Peppol BIS · fatal · BT-131

For a sample invoice, the library reports: Line 1 states a net amount (BT-131) of 77.77, but its own quantity, price and line-level allowances and charges compute to 1500.00 — a difference of -1422.23 EUR. The line net amount is not a figure you get to state independently: it is BT-129 × (BT-146 / BT-149) − Σ BT-136 + Σ BT-141.

Business term
BT-131
Severity
fatal

The fix

Either correct the quantity (BT-129), the item net price (BT-146), the base quantity (BT-149) or the line allowances and charges so they produce 77.77, or drop declaredTotals.lineNetAmounts and let the library compute the line. Round the line once, at the end, to two decimals — rounding the price first is the usual cause of a one-cent break.

A passing value

the shape this field expects
"quantity": 10, "unitPrice": 150

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": "PEPPOL-EN16931-R120",
  "field": "BT-131",
  "severity": "fatal",
  "message": "Line 1 states a net amount (BT-131) of 77.77, but its own quantity, price and line-level allowances and charges compute to 1500.00 — a difference of -1422.23 EUR. The line net amount is not a figure you get to state independently: it is BT-129 × (BT-146 / BT-149) − Σ BT-136 + Σ BT-141.",
  "fix": "Either correct the quantity (BT-129), the item net price (BT-146), the base quantity (BT-149) or the line allowances and charges so they produce 77.77, or drop declaredTotals.lineNetAmounts and let the library compute the line. Round the line once, at the end, to two decimals — rounding the price first is the usual cause of a one-cent break.",
  "example": "\"quantity\": 10, \"unitPrice\": 150",
  "xpath": "/ubl:Invoice/cac:InvoiceLine[1]/cbc:LineExtensionAmount",
  "docsUrl": "https://attestwire.com/rules/PEPPOL-EN16931-R120"
}

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