Blog Data formats No. 10

Units of measure on purchase orders and UN/ECE codes

A quantity means nothing without its unit, and units are the least standardised thing on a purchase order. One customer writes EA, another each, another pcs, another nothing at all. The cost of getting it wrong is real: 25 boxes of 200 screws is 5,000 screws, and 25 screws is not.

UN/ECE Recommendation 20

The United Nations Economic Commission for Europe maintains a list of codes for units of measure used in international trade, known as Recommendation 20. It is the list behind units in UBL, PEPPOL and many EDI messages. A few of the codes you will meet most on orders:

CodeUnit
EAeach
H87piece
BXbox
PKpack
CScase
PRpair
SETset
DZNdozen
ROroll
KGMkilogram
GRMgram
LTRlitre
MTRmetre
MTKsquare metre
HURhour

The list is long and covers everything from tonnes to kilowatt hours. Using it means your systems agree on what BX means, whoever sent the order.

How VioPO handles units

VioPO maps the common ways of writing a unit to these codes: each, ea, unit and units become EA; box and boxes become BX; kg and kilos become KGM. A unit it does not recognise is returned as printed, in upper case. We would rather pass on an unfamiliar unit than guess the wrong one.

When a quantity cell holds both, such as "2 cases", the number goes in quantity and the unit in unit_of_measure.

The pack size problem

Codes solve spelling. They do not solve pack sizes. "Wood screws 4 x 40mm (box of 200), 25 BX" is clear to a person. To your system it is 25 boxes of a product you might stock as single screws, boxes of 200 or boxes of 100.

There is no general fix, because it depends on your product data. What works in practice:

  • Keep a conversion per product. For each product, record the units you sell it in and the conversion between them.
  • Check the line amount. If quantity times your price for the unit does not come near the line amount on the order, the unit is probably wrong.
  • Learn from corrections. When a person fixes a unit on a customer's order, save the customer, their part number, their unit and yours.

Units and prices

A price is per unit, and the unit for the price is not always the unit for the quantity. Some orders price per hundred or per thousand ("£6.85 per 100"). VioPO's arithmetic check will usually catch this: if quantity times unit price is a hundred times the printed line amount, the line_amounts check fails and the order is flagged for review.

The docs list every field VioPO returns for a line.