Rule reference

PEPPOL-EN16931-R040 The document level allowance states an amount of 60.00 EUR, a base amount of 1000.00 and a percentage of 5%

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.

This rule is implemented and its error payload below is real, but the long-form write-up — normative text, worked example, divergence note — is not written yet. Everything the library knows about this rule is on this page. Ask and we will prioritise it.

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

What the library returns

The exact object in result.errors when this rule fires. Generated by running @attestwire/en16931, not transcribed:

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 locates the element in the generated UBL document, which is where a KoSIT or Peppol validator will report the same problem.

A passing value

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

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.

Arrived from a stack trace? The docsUrl on every error links straight here. Something wrong on this page — tell us.