AttestwireRule referencePEPPOL-EN16931-R040

PEPPOL-EN16931-R040 An allowance or charge amount must equal base amount × percentage

noun · Peppol BIS · fatal · BT-92 / BT-93 / BT-94

For a sample invoice, the library reports: The document level allowance states an amount of 60.00 EUR, a base amount of 1000.00 and a percentage of 5%. Peppol requires the three to agree: 1000.00 x 5% = 50.00, and the difference here is 10.00.

Business term
BT-92 / BT-93 / BT-94
Severity
fatal

The fix

Recompute allowances[0].amount as baseAmount x percentage / 100, rounded to two decimals — this package exports round2() for exactly that. If the amount is right and the base is stale, correct the base instead; if the adjustment is not proportional at all, remove both baseAmount and percentage and state the amount alone.

A passing value

the shape this field expects
{ "amount": 50.00, "baseAmount": 1000.00, "percentage": 5 }

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": "PEPPOL-EN16931-R040",
  "field": [
    "BT-92",
    "BT-93",
    "BT-94"
  ],
  "severity": "fatal",
  "message": "The document level allowance states an amount of 60.00 EUR, a base amount of 1000.00 and a percentage of 5%. Peppol requires the three to agree: 1000.00 x 5% = 50.00, and the difference here is 10.00. The tolerance is 0.02 in the invoice currency — tight, unlike the whole-unit tolerance EN 16931 allows on the VAT rules, because this is not a rounding-strategy question but a multiplication that either was or was not performed. The usual cause is a base amount that was updated when the line changed and an amount that was not. This is a Peppol BIS Billing 3.0 profile rule: it applies because profile is \"peppol-bis-3\". It does not apply to the en16931, xrechnung-ubl or xrechnung-cii profiles, whose validators will accept the same document.",
  "fix": "Recompute allowances[0].amount as baseAmount x percentage / 100, rounded to two decimals — this package exports round2() for exactly that. If the amount is right and the base is stale, correct the base instead; if the adjustment is not proportional at all, remove both baseAmount and percentage and state the amount alone.",
  "example": "{ \"amount\": 50.00, \"baseAmount\": 1000.00, \"percentage\": 5 }",
  "xpath": "/ubl:Invoice/cac:AllowanceCharge[1]/cbc:Amount",
  "docsUrl": "https://attestwire.com/rules/PEPPOL-EN16931-R040"
}

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