Attestwire › Rule reference › BR-28
BR-28 The item gross price must not be negative
noun · EN 16931 · fatal · BT-148
For a sample invoice, the library reports: Line 1 (id "1") has a negative item gross price (BT-148: -200). The gross price is the list price *before* the item price discount (BT-147) is taken off, so it is the larger of the two figures by construction — a negative one means the sign has been applied at the wrong end.
- Business term
BT-148- Severity
fatal
The fix
Set line.grossUnitPrice to the positive list price and line.priceDiscount to the reduction. If the price genuinely is the net price, omit grossUnitPrice entirely — this build derives the discount as grossUnitPrice − unitPrice when you do not state it.
A passing value
"grossUnitPrice": 200, "priceDiscount": 50, "unitPrice": 150What 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:
{
"rule": "BR-28",
"field": "BT-148",
"severity": "fatal",
"message": "Line 1 (id \"1\") has a negative item gross price (BT-148: -200). The gross price is the list price *before* the item price discount (BT-147) is taken off, so it is the larger of the two figures by construction — a negative one means the sign has been applied at the wrong end. EN 16931 models every reduction as an allowance or a discount, never as a negative price, and BR-27 says the same thing about the net price (BT-146).",
"fix": "Set line.grossUnitPrice to the positive list price and line.priceDiscount to the reduction. If the price genuinely is the net price, omit grossUnitPrice entirely — this build derives the discount as grossUnitPrice − unitPrice when you do not state it.",
"example": "\"grossUnitPrice\": 200, \"priceDiscount\": 50, \"unitPrice\": 150",
"xpath": "/ubl:Invoice/cac:InvoiceLine[1]/cac:Price/cac:AllowanceCharge/cbc:BaseAmount",
"docsUrl": "https://attestwire.com/rules/BR-28"
}
xpath is always a UBL path. On a CII invoice, look for the
matching CII field instead.