All rules · pint-om · error

IBR-157-OM

The item net price must equal the gross price minus the price discount.

Reviewed

Why this rule exists

The net price is what the line amount is computed from. If it disagrees with the gross price and discount you also stated, the two arithmetic paths through the document give different answers.

Why it usually happens

How to fix it

Compute net = gross - discount once, and serialize all three from that single computation.

The official rule

Item net price (IBT-146) must be equal to (Item gross price (IBT-148) minus (-) Item price discount (IBT-147)) when item gross price is provided.

Verbatim from the published artefact. We execute the official Schematron unmodified, so this is exactly what an Access Point checks.

Schematron test

not(cac:Price/cac:AllowanceCharge/cbc:BaseAmount)                     or (                         cac:Price/cbc:PriceAmount castable as xs:decimal and                          cac:Price/cac:AllowanceCharge/cbc:BaseAmount castable as xs:decimal and                         u:slack(                             xs:decimal(cac:Price/cbc:PriceAmount),                             xs:decimal(                                 round(                                     (                                         xs:decimal(cac:Price/cac:AllowanceCharge/cbc:BaseAmount) -                                         sum(cac:Price/cac:AllowanceCharge/cbc:Amount/xs:decimal(.))                                     ) * 100                                 ) div 100                             ),                             0.01                         )                     )

Applied to nodes matching cac:InvoiceLine | cac:CreditNoteLine

Rule-pack versions

Rule-packLayerSeverityApplies to
pint-om-1.0.1pint-omerrorbilling/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice
pint-om-1.0.0pint-omerrorbilling/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice

Related rules

ibr-147-ae · ibr-027

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