# PEPPOL-EN16931-R120

Source: https://xmlvalid.com/rules/PEPPOL-EN16931-R120

> Invoice line net amount MUST equal (Invoiced quantity * (Item net price/item price base quantity) + Sum of invoice line charge amount - sum of invoice line allowance amount

- Level: error
- Rule sets: Peppol BIS Billing 3.0 rules 3.0.21
- Context: `cac:InvoiceLine | cac:CreditNoteLine`
- Test: `u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, 0.02)`

> Invoice line net amount MUST equal (Invoiced quantity * (Item net price/item price base quantity) + Sum of invoice line charge amount - sum of invoice line allowance amount

- Level: warning
- Rule sets: XRechnung 3.0 rules (UBL) 2.6.0
- Context: `cac:InvoiceLine | cac:CreditNoteLine`
- Test: `u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, $slackValue)`

> Invoice line net amount MUST equal (Invoiced quantity * (Item net price/item price base quantity) + Sum of invoice line charge amount - sum of invoice line allowance amount

- Level: warning
- Rule sets: XRechnung 3.0 rules (CII) 2.6.0
- Context: `ram:IncludedSupplyChainTradeLineItem`
- Test: `u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, $slackValue)`

## Why it fails

- A line's net amount doesn't equal quantity × (net price ÷ base quantity) plus line charges minus line allowances; often the price has more decimals than were used, or a base quantity (price per 100) was ignored.

## How to fix it

- Recalculate `cbc:LineExtensionAmount` from the values in the line. The rule allows a difference of 0.02.

Validate a document against these rules: https://xmlvalid.com/validate
