All rules · pint-om · error
IBR-137-OM
All amounts and quantities must be zero or positive, except where a negative value is explicitly permitted.
Reviewed
Why this rule exists
A negative amount usually means a reversal expressed in the wrong document. Credits belong in a credit note and reductions in an allowance, both of which carry positive numbers and the right semantics.
Why it usually happens
- Modelling a refund as an invoice with negative lines
- A sign error when reversing a transaction
- Using a negative quantity to represent a return
How to fix it
Issue a credit note with positive amounts, or express the reduction as an AllowanceCharge.
The official rule
All invoice amounts and quantities shall be zero or positive, except for rounding amount (IBT-114).
Verbatim from the published artefact. We execute the official Schematron unmodified, so this is exactly what an Access Point checks.
Schematron test
not( ( descendant::cbc:TaxExclusiveAmount | descendant::cbc:TaxInclusiveAmount | descendant::cbc:AllowanceTotalAmount | descendant::cbc:ChargeTotalAmount | descendant::cbc:PrepaidAmount | descendant::cbc:PayableAmount | descendant::cbc:Amount | descendant::cbc:PriceAmount | descendant::cbc:BaseAmount | descendant::cbc:Quantity | descendant::cbc:BaseQuantity | descendant::cbc:InvoicedQuantity | descendant::cbc:CreditedQuantity | descendant::cbc:TaxAmount | descendant::cbc:LineExtensionAmount ) [ local-name() != 'PayableRoundingAmount' and normalize-space(.) != '' and . castable as xs:decimal and xs:decimal(.) < 0 ] )
Applied to nodes matching ubl:Invoice | cn:CreditNote
Rule-pack versions
| Rule-pack | Layer | Severity | Applies to |
|---|---|---|---|
| pint-om-1.0.1 | pint-om | error | billing/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice |
| pint-om-1.0.0 | pint-om | error | billing/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice |
Related rules
Check your own invoice
Paste your XML and see every rule that fires, not just this one. Free, no sign-up, and we never store the document.
Open the validator