Supply Lens

How a line's unit is decided

Lesson 14 of 24 8 min read

Follow the exact order Supply Lens works through to decide the unit of each order line, from the sender's own unit to the barcode it was ordered by to your defaults.

You now have units, conversions, identifier units and three kinds of default. When an order line arrives, which one wins? This lesson walks through the order Supply Lens follows, so you can predict the result for any line and work out why a line came out in the unit it did.

When this happens

Working out a line's unit is part of enrichment, the step after cross-referencing that fills in what the sender left out (see How Supply Lens recognises things). It applies to documents with lines, such as orders, order changes, invoices, credits, shipments, purchase orders, warehouse orders and goods inbound documents. It only runs when your organisation has Products and a default single unit configured.

The order of checks

For each line whose Product has been matched but whose unit hasn't, Supply Lens works down this list and stops at the first answer:

Rendering diagram...

In words:

  1. The identifier it was ordered by. If the sender gave no unit and no traded unit size, and the line was ordered by an identifier that carries a unit (such as a GTIN-14 marked Case), that unit is used. This comes first because it is direct evidence of what was ordered.
  2. The Product's default for the source Integration.
  3. A traded unit size, if the sender gave one: a size of 1 means your organisation's single unit; a larger size means the unit whose conversion holds that many singles. If no conversion matches, the Document fails.
  4. The Integration's default unit.
  5. The Product's default unit.
  6. Otherwise the line is left unresolved.

Once the unit is known, any price for the line is looked up in that unit.

When identifiers disagree

A line can carry more than one identifier, for example both the bag barcode (marked Bag) and the case barcode (marked Case). If the matching identifiers imply different units, none of them is used. Supply Lens logs a warning and falls through to the defaults.

If several identifiers match, only the ones at the most specific scope count, using the same order as before: Party, then country, then currency, then Integration. A GTIN-14 scoped to the customer outranks an unscoped one.

Worked examples

House Blend 250g has a GTIN-13 marked Bag and a GTIN-14 marked Case. Its Product default is Bag.

The line sendsUnit usedWhy
GTIN-14, quantity 3, no unit3 CaseThe case barcode carries a unit, and nothing else was said
GTIN-13, quantity 3, no unit3 BagThe bag barcode carries a unit
GTIN-13 and GTIN-14, quantity 3From the defaultsThe two barcodes disagree, so a warning is logged and the defaults decide
GTIN-14 with a unit statedNot from the identifierThe sender gave a unit, so the identifier rule stands aside
SKU only, no unitFrom the defaultsThe SKU carries no unit

Greenleaf and Shopify on the same day

  • Greenleaf orders 3 against the case barcode with no unit. The barcode is marked Case, so the line is read as 3 Case, and Greenleaf's case price is looked up. With the conversion of 1 Case = 6 Bag, that is 18 bags from Brookside's stock.
  • Shopify sends an order for 2 of the Café Starter Kit by SKU, with no unit. The SKU carries no unit and there is no traded unit size, so the defaults decide. The Shopify Integration default (Bag) comes before the kit's Product default (Case), so the line is read as 2 Bag.

What you'll see in the logs

Log messageMeaning
Resolved unit of measure for line number N as X from the product identifier it was matched onThe identifier's unit was used
The product identifiers line number N was matched on imply different units of measure (…), so none of them has been appliedThe identifiers disagreed; the defaults decided instead

Mark your case barcodes

If partners order by GTIN-14, mark each GTIN-14 as standing for a case (on the Product page, or with the identifier uom column in a Product import). It is the most reliable way to make "3" mean three cases.

Recap

  • A line's unit is worked out during enrichment, stopping at the first answer.
  • The identifier the line was ordered by comes first, if the sender gave no unit or traded unit size.
  • Then the Product default for the source Integration, a traded unit size, the Integration default and finally the Product default.
  • If matching identifiers imply different units, none is used and the defaults decide.
  • The unit is decided before the price is looked up.
Complete and take the quiz

Your progress is saved in this browser. Create a free account to keep it everywhere, take quizzes and earn certificates.