AttestwireRule referenceBR-DEC-16

BR-DEC-16 The paid amount may have at most two decimals

noun · EN 16931 · fatal · BT-113

For a sample invoice, the library reports: The paid amount (BT-113) is 10.005, which carries 3 decimals; EN 16931 allows at most 2.

Business term
BT-113
Severity
fatal

The fix

Round paidAmount to 2 decimals, taking the value from the payment record rather than recomputing it from a percentage of the invoice total.

A passing value

the shape this field expects
"paidAmount": 500.00

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-DEC-16",
  "field": "BT-113",
  "severity": "fatal",
  "message": "The paid amount (BT-113) is 10.005, which carries 3 decimals; EN 16931 allows at most 2. BT-113 is money that has already moved — a deposit, a prepayment, a part-settlement — so it is by definition a figure some bank has already booked to the cent, and a value with more precision than that describes a payment nobody made. It also feeds BT-115 directly (BR-CO-16 derives the amount due from it), so the extra digits propagate into the one number the buyer actually pays.",
  "fix": "Round paidAmount to 2 decimals, taking the value from the payment record rather than recomputing it from a percentage of the invoice total.",
  "example": "\"paidAmount\": 500.00",
  "xpath": "/ubl:Invoice/cac:LegalMonetaryTotal/cbc:PrepaidAmount",
  "docsUrl": "https://attestwire.com/rules/BR-DEC-16"
}

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