PEPPOL-EN16931-R046
Item net price MUST equal (Gross price - Allowance amount) when gross price is provided.
Why it fails
- The line gives a gross price (
cac:AllowanceCharge/cbc:BaseAmountincac:Price) and a price discount, but the net price isn't gross price minus discount.
How to fix it
Make cbc:PriceAmount equal the gross price minus the price discount amount.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
cac:Price/cac:AllowanceCharge
not(cbc:BaseAmount) or xs:decimal(../cbc:PriceAmount) = xs:decimal(cbc:BaseAmount) - xs:decimal(cbc:Amount)
Checked with Peppol BIS Billing 3.0 Invoice, Peppol BIS Billing 3.0 Credit Note
rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeAgreement/ram:GrossPriceProductTradePrice
not(ram:ChargeAmount) or xs:decimal(../ram:NetPriceProductTradePrice/ram:ChargeAmount) = xs:decimal(ram:ChargeAmount) - u:decimalOrZero(ram:AppliedTradeAllowanceCharge/ram:ActualAmount[1])
Checked with XRechnung 3.0 Invoice (CII)