PEPPOL-EN16931-R130fatal

How to fix PEPPOL-EN16931-R130

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

What this rule checks

When a line has a price base quantity (BT-149, cbc:BaseQuantity) with a unitCode, that unit code (BT-150) must be the same as the unit code of the invoiced quantity (BT-130). You cannot price by kilograms but invoice by pieces. R130 only compares the two unit codes. Looking for PEPPOL-EN16931-R120? That rule checks the line net amount calculation (quantity × net price / base quantity, plus charges, minus allowances).

How to fix it

Ensure cac:Price → cbc:BaseQuantity/@unitCode matches cbc:InvoicedQuantity/@unitCode (or cbc:CreditedQuantity/@unitCode) on the same invoice line.

Common causes

  • The system writes a fixed default unit code (for example C62) on cbc:BaseQuantity, but the line is invoiced in another unit, such as HUR.
  • The price is kept per package (for example XBX) while the quantity is invoiced per piece (H87).
  • On a credit note, cbc:CreditedQuantity uses a different unit code than cbc:BaseQuantity.

Example: before (broken)

<cac:InvoiceLine>
  <cbc:ID>1</cbc:ID>
  <cbc:InvoicedQuantity unitCode="HUR">8</cbc:InvoicedQuantity>
  <cbc:LineExtensionAmount currencyID="EUR">680.00</cbc:LineExtensionAmount>
  <cac:Price>
    <cbc:PriceAmount currencyID="EUR">85.00</cbc:PriceAmount>
    <!-- C62 does not match HUR -->
    <cbc:BaseQuantity unitCode="C62">1</cbc:BaseQuantity>
  </cac:Price>
</cac:InvoiceLine>

Example: after (fixed)

<cac:InvoiceLine>
  <cbc:ID>1</cbc:ID>
  <cbc:InvoicedQuantity unitCode="HUR">8</cbc:InvoicedQuantity>
  <cbc:LineExtensionAmount currencyID="EUR">680.00</cbc:LineExtensionAmount>
  <cac:Price>
    <cbc:PriceAmount currencyID="EUR">85.00</cbc:PriceAmount>
    <cbc:BaseQuantity unitCode="HUR">1</cbc:BaseQuantity>
  </cac:Price>
</cac:InvoiceLine>

Related rules

Rule sets

PEPPOL-EN16931-R130 is in these rule sets. Each page lists all its rules and the pinned version.

Validate your invoice

Upload your corrected invoice to check it passes PEPPOL-EN16931-R130 and all other EN 16931 and Peppol BIS 3.0 rules. Free, instant, no signup.