Units and quantities
Every product has a base unit — the unit its stock is counted in, and the unit every rule compares against.
Units are a fixed catalogue, not records you create. They are the UN/ECE codes an e-invoice names a quantity with, which is what makes a quantity mean the same thing to whoever receives the document. A unit nobody can name to a receiver is not a unit.
Dimensions
Section titled “Dimensions”Each unit belongs to a dimension: count, mass, length, area, volume, duration, period, lump sum. Gram, kilogram and tonne are one dimension, so a quantity converts freely between them.
Quantities never convert across a dimension. There is no answer to how many kilograms an hour is, and the system does not pretend otherwise.
That is also why duration (hour, day) and period (month, year) are separate dimensions: a month is not a fixed number of hours.
Which units a product can use
Section titled “Which units a product can use”A unit is valid for a product when it shares the product’s base-unit dimension. Nothing else can carry a price or reach an order line, and that set is exactly what a line’s unit picker offers.
So a product based in Kilogram can be priced in grams or tonnes, never in hours. A product based in Piece can be sold by the dozen.
Sales Unit on the product pre-fills the unit on new order lines. It is a starting point, not a restriction, and it has to share the base unit’s dimension like anything else.
Conversion and rounding
Section titled “Conversion and rounding”A converted quantity is rounded to six decimal places, which is the precision a quantity is stored at — so the value a rule compares is the value the system gives back.
Prices are not rounded to cents anywhere. A price of 100 per box of 12 reaches an
each-line as 8.333333. See How a price is chosen.
A quantity that converts to zero is rejected rather than posted as nothing.
Where the base unit shows up
Section titled “Where the base unit shows up”- Stock is counted and displayed in it.
- Price tiers are compared in it, which is why “from 1 dozen” and “from 1 piece” are different thresholds.
- Fulfillment orders are written in it, whatever unit the sales line used.
- Picked quantity on a sales line is summed in it, so an order for one box of 12 pieces reads as 12 pieces picked. Invoiced quantity stays in the line’s own unit.
What locks
Section titled “What locks”Base Unit, Physical Product and Lot Tracked cannot be changed once any stock has moved for the product. Changing them would reinterpret history already written.
Setting them is Products.