AttestwireRule referenceBR-27

BR-27 The item net price must not be negative

noun · EN 16931 · fatal · BT-146

For a sample invoice, the library reports: Line 1 (id "1") has a negative item net price (BT-146: -5). The net price must never be negative — EN 16931 models reductions as allowances, not as negative prices.

Business term
BT-146
Severity
fatal

The fix

Make unitPrice positive and express the reduction as a line allowance instead — line.allowances[] carries the amount (BT-136), an optional base amount and percentage (BT-137/BT-138) and a reason (BT-139/BT-140), and it is subtracted from the line net amount for you. That is the mechanism EN 16931 intends here.

To reverse a supply entirely, issue a credit note: set invoiceTypeCode to "381" and state the amounts positively, with precedingInvoices naming the invoice you are crediting (BT-25). The document type, not the sign, is what conveys the direction. "384" (corrected invoice) is the third option, for a process that replaces the earlier document rather than adjusting it.

A passing value

the shape this field expects
"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": "BR-27",
  "field": "BT-146",
  "severity": "fatal",
  "message": "Line 1 (id \"1\") has a negative item net price (BT-146: -5). The net price must never be negative — EN 16931 models reductions as allowances, not as negative prices.",
  "fix": "Make unitPrice positive and express the reduction as a line allowance instead — line.allowances[] carries the amount (BT-136), an optional base amount and percentage (BT-137/BT-138) and a reason (BT-139/BT-140), and it is subtracted from the line net amount for you. That is the mechanism EN 16931 intends here. To reverse a supply entirely, issue a credit note: set invoiceTypeCode to \"381\" and state the amounts positively, with precedingInvoices naming the invoice you are crediting (BT-25). The document type, not the sign, is what conveys the direction. \"384\" (corrected invoice) is the third option, for a process that replaces the earlier document rather than adjusting it.",
  "example": "\"unitPrice\": 150",
  "xpath": "/ubl:Invoice/cac:InvoiceLine[1]/cac:Price/cbc:PriceAmount",
  "docsUrl": "https://attestwire.com/rules/BR-27"
}

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