Fixture ID: peppolAllowanceArithmetic · XPath: /ubl:Invoice/cac:AllowanceCharge[1]/cbc:Amount
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.
PEPPOL-EN16931-R040Recompute 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.
{ "amount": 50.00, "baseAmount": 1000.00, "percentage": 5 }