# PEPPOL-EN16931-R130

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

> Unit code of price base quantity MUST be same as invoiced quantity.

- Level: error
- Rule sets: Peppol BIS Billing 3.0 rules 3.0.21, XRechnung 3.0 rules (UBL) 2.6.0
- Context: `cac:Price/cbc:BaseQuantity[@unitCode]`
- Test: `not($hasQuantity) or @unitCode = $quantity/@unitCode`

> Unit code of price base quantity MUST be same as invoiced quantity.

- Level: error
- Rule sets: XRechnung 3.0 rules (CII) 2.6.0
- Context: `ram:NetPriceProductTradePrice/ram:BasisQuantity[@unitCode] | ram:GrossPriceProductTradePrice/ram:BasisQuantity[@unitCode]`
- Test: `@unitCode = ../../../ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCode`

## Why it fails

- The base quantity of the price has a different `unitCode` from the invoiced quantity (prices per kilogram, quantities in pieces).

## How to fix it

- Use the same unit for both, and convert the price if needed.

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