Task 0429: UMRP / UPP minimum-price enforcement plan

Prepared October 10, 2026; revised the same day to keep MAP and UMRP separate. Approved by Phil 2026-10-10 12:13 PM MT: all 13 decisions as recommended, with scope limited to slice A. No code, migration or CI yet (task is in ready, awaiting build go-ahead). Baseline: origin/staging 10ebcbe3c0.

Approved scope (slice A only)

  1. M0: add a nullable umrp_price column to every warehouse stock table and to the new-warehouse stock-table template. It's version-tracked, global across warehouses like map_price, and editable in the stock file and batch import.
  2. Pricing dialog check: warn or block when a sale, flyer or purchase-promo price is below the UMRP (decision 2).
  3. Bulk paths: umrp_price is handled wherever map_price is: bulk update, bulk insert/import and warehouse copy (Phil, 12:14 PM).
  4. Register warning: warn when a line's per-each net price is at or below the UMRP. Warning only, no block (decisions 3 and 4).

Out of scope: umrp_policies, umrp_overrides, umrp_item_prices, coupon capping, reports and register blocking. map_price stays the advertised price only and isn't touched.

1. Research: what UMRP/UPP policies require

Topic What real policies say Source
MAP vs UMRP (the key distinction) MAP (Minimum Advertised Price) limits only the price we advertise or display: web listings, flyers, emails, cart or chat prices. We can still sell below MAP to a customer in the store or through quotes and negotiation. UMRP/UPP (Unilateral Minimum Resale/Retail Price) limits the net price actually charged on the invoice, after every discount, coupon or rebate, no matter how it's advertised. So MAP is a marketing and web control, while UMRP is a point-of-sale control. One item can have a MAP, a UMRP, both or neither, and the two numbers can differ. That's why they're separate fields: map_price and umrp_price. Star group; S&B; Verona
Advertised vs sold MAP/IMAP limits the advertised price only. Star/APW/Bakers Pride (Middleby group) says MAP "do[es] not apply to the price at which products are actually sold". UMRP/UPP limits the net sold price. S&B: "A MAP program is focused on the advertised price while a Unilateral Pricing Policy is concerned about the actual selling price." Star group MAP/MRICP, S&B UPP
Internet cart price Star's MRICP covers the final online checkout, chat and emailed prices: no more than 52% off list for listed lines. That's a formula (percent of list), not a fixed dollar amount. Star group
Discounts and coupons Coupons, rebates, free accessories and paying the customer's sales tax all count as discounts, and they're violations if they put the net price below UMRP. Verona/EuroChef UMRP, CSF UPP
Store-wide promos A store-wide percent-off is allowed only if UMRP items are explicitly excluded or still net at or above UMRP. Trevarrow UMRP Q&A
Bundles No single bundle price that hides the UMRP item. A bundle must total at least the sum of its items' minimums, or the vendor's own bundle price. Verona; SW-Motech UPP; CSF
Exceptions Display units more than a year after the vendor's invoice date, marked "DISPLAY UNIT" on the invoice (Trevarrow). Free shipping or installation is sometimes allowed (S&B). Some policies have separate distributor-to-dealer and retail minimums (Air Lift). Trevarrow; S&B; Air Lift UPP
Effective dates Prices come from the vendor's current price list. Verona gives at least 30 days' notice of changes, SW-Motech about 5 days. Promo windows can suspend the policy (PizzaMaster). Violations are judged against the price in effect at the time of sale. Verona; SW-Motech; PizzaMaster IMAP; Trevarrow
Price lists Vendors publish UMRP as a column in the list price book, e.g. Perlick's "UMRP Price List". Our AutoQuotes catalog already imports MapMrpPrice and MapMrpEndDate (app/services/procurement/auto_quotes_catalog_upsert.rb:86-87 → aq_catalog.map_mrp_price/map_mrp_end_date, db/structure.sql:20980-20981). Perlick UMRP list
Price matching Policies treat matching a competitor below UMRP as a violation: the net price is what counts. Air Lift also prohibits "in-store-only" prices meant to get around the policy. Air Lift; CSF
Penalties The vendor cuts off supply (Verona: 3 months, then indefinitely), not fines. That's why a warning plus override can be acceptable, as long as overrides are visible. Verona; Trevarrow
Legal These policies are unilateral (Colgate doctrine). We must not "agree" with vendors or other dealers on prices. The system should record the vendor's published minimum and our own decision, never coordinate it. Some states (e.g. Maryland) are stricter. Bona Law on Colgate, Leegin

Family Stores vs Standard: both run this same codebase against separate databases. Family Stores sells retail and consumer brands (more MAP/IMAP), while Standard is foodservice equipment (more UMRP plus internet cart price). The plan keeps behavior per database and per vendor policy, with no hard-coded tenant branches (compare the "SPECIFICALLY FOR FAMILY STORES" blocks at app/models/inventory_item.rb:681,692, which we should not repeat).

2. Best practices

3. Unit-of-measure verification and the per-each formula

Verified on origin/staging 10ebcbe3c0.

Stock prices are per each. list_price, sale_price, fs_price (flyer) and ps_price (purchase promo) are stored once per stock item (app/models/warehouseinfo.rb:636-678). The register multiplies them by case_qty to price the selling unit: ROUND((list_price * :case_qty), 2) (app/models/order_item.rb:313) and ROUND((COALESCE(cust_price_override, LEAST(sale_price, cust_price, st_codeprice_ng)) * :case_qty), 2) sold_price (order_item.rb:330-343). Quantity breaks also count eaches: ABS(:order_qty) * :case_qty >= qty_brk (order_item.rb:324). The Pricing dialog fields (PriceDialog.tsx:299-314) write those same stock columns, so Pricing dialog prices are per each, and umrp_price is stored per each too. The dialog check compares them directly: price > 0 AND price < umrp_price.

Line prices are per selling unit. In orderitem (db/structure.sql:39812) and invitemhist (db/structure.sql:24021-24058), case_qty is the number of eaches in the line's unit of measure, order_qty is the number of those units, and sold_price is the price per unit of measure. The model comment says so directly: "the sold_price will be the price per ord, calculating the UM qty … UM:12 ORD:1 the sold_price would be $12 … the sold price is basically the price per UM" (order_item.rb:243-248). The line discount is sold_disc (a percent), and the extension is sold_price*order_qty - sold_price*order_qty*(sold_disc/100) (order_item.rb:557). orderitem has no separate UM-code column. The unit is fully described by case_qty.

Existing precedent (task-0404 below-cost sales): cost is per each, so line cost = (cost + freight) * order_qty * COALESCE(NULLIF(case_qty,0),1) and profit = extension - that (app/controllers/branch_control_panel_v2_controller.rb:1084-1092, again at :2866-2868). Older reports use the same idea without the zero guard (app/models/salesman.rb:2277, app/models/stock_item.rb:110).

Formula

units_each   = COALESCE(NULLIF(case_qty, 0), 1)                 -- same zero guard as task-0404
net_each     = sold_price * (1 - COALESCE(sold_disc, 0) / 100) / units_each
-- equivalent when order_qty <> 0:  extension / (order_qty * units_each)
violation    = umrp_price > 0 AND net_each <  umrp_price   (warn)
at_minimum   = umrp_price > 0 AND net_each =  umrp_price   (informational warn, decision 4)

Compare after rounding net_each to 4 decimals, so a case price that rounds to the cent doesn't trigger a false warning (e.g. $10.00 a case of 3 = $3.3333 each).

Phil's example: a case of 12 sold at $120 gives case_qty=12, sold_price=120, sold_disc=0, so net_each = 120/12 = $10.00. Against a UMRP of $12 that's a violation, and the line shows a warning.

Edge cases

Case Handling
Each UM case_qty = 1, so net_each = sold_price × (1 − disc).
Case UM case_qty = N, so divide by N (formula above).
Broken case (selling eaches from a case) Entered as case_qty = 1, order_qty = eaches. The formula already gives the each price, so no special case is needed.
Zero case_qty Model validation requires case_qty > 0 (order_item.rb:23). Legacy or history rows may have 0, which is treated as 1 like task-0404.
order_qty 0 or negative (credits/returns) Use the sold_price form, not the extension form. Never warn on credit/return lines (negative order_qty).
Quantity-break discount Already in sold_disc (set by OrderItem.price, order_item.rb:384-398), so it's included.
Manual sold_disc edits Included, since the formula uses the stored sold_disc.
Kits/bundles POS has no kit entity. Bundles are separate lines or add-ons (useEditRow/AddonDialog.tsx), and each product line is checked on its own (decision 7).
Services / comment lines Skip lines where good_service = 'S' or item_type <> 'product'.
Order-level coupon Not included in slice A (coupon capping, decision 6, is a later slice). The invoice re-check uses line net only. Documented as a known gap.
No umrp_price / 0 No check.

4. Slice A design

M0 migration (both Standard and Family Stores databases; dev/review first):

Wiring (everywhere map_price is listed): BatchStockUpdateFormatter::GLOBAL_KEYS (app/lib/batch_stock_update_formatter.rb:6-10), StockItemsController#update_params and GLOBAL_PERMITTED_PARAMS (stock_items_controller.rb:1714-1727), stock_items_helper.rb:94-101, batch import columns (batch_imports_controller.rb:39,107), the stock file field list (stock_file/Index.tsx:1549) labeled "UMRP (min sold price)", and the stock read query (app/models/stock.rb:964) so the register gets it.

Bulk update / bulk insert paths (Phil, 12:14 PM: umrp_price must be handled wherever map_price is). I searched current origin/staging (4e3e878007) and every db/*.sql file. No SQL/PLpgSQL function named bulk_update/bulk_insert (or any stock bulk function) exists: the only bulk_* hits are unrelated (ESL tags, rebates, requisitions, financial entries, RFID scans, inventory totals), and no SQL function references map_price. The stock bulk paths are Ruby, and each one gets umrp_price next to map_price:

Path What it does Change
BatchStockUpdate.update (app/lib/batch_stock_update.rb:269-296) Bulk update across warehouses with upsert_all and hand-built StockVersion rows (:298) Takes columns from BatchStockUpdateFormatter, so add umrp_price to GLOBAL_KEYS (app/lib/batch_stock_update_formatter.rb:6-10). It then updates every warehouse and gets versioned by build_versions.
Batch Updates column list (app/controllers/batch_updates_controller.rb:28) Columns offered in the bulk-update UI Add "umrp_price" after "map_price". Don't add it to aqColumns (:39), because the AutoQuotes MAP field isn't UMRP (decision 12).
Batch import / bulk insert (app/controllers/batch_imports_controller.rb:39,107) Column list and permitted params for importing new stock rows Add umrp_price to both.
Stock-file field constraints (app/javascript/apps/stock/stock_file/stockFileFieldConstraints.ts) Client-side numeric validation for stock fields Validate umrp_price the same way as map_price (a finite number ≥ 0, blank allowed).
Warehouse copy inserts: Stock.copy_missing_items (app/models/stock.rb:193-214) and copy_missing_catalog_stock_rows (:234-285, insert_all) Copy every column between warehouse stock tables No list change needed, since they copy all columns not in WAREHOUSE_SPECIFIC_STOCK_SYNC_COLUMNS (:220-224), so umrp_price copies as a catalog value. They require the same column count in every stock table (:198-200), so M0 must reach every stock table at once (use StockFactory.stock_tables, as the map_price migration did in db/migrate/20240329201218_add_map_price_to_stock_tables.rb).
db/structure.sql (10 stock tables listing map_price, e.g. :52282) Schema dump Regenerated by the migration so each stock table has umrp_price.
Seeds (lib/tasks/pos_app/seed/rfid.rake:195,908,1301) Dev seed data Optional: seed umrp_price for dev/review test items.

Bulk-path tests:

Pricing dialog:

Register warning:

Permission: overrideUmrp, granted to managers and pricing admins (decision 13).

Verification: the bulk-path tests above, plus model/unit tests for net_each (each, case, broken case, zero case_qty, discount, credit), a controller test for the pre-enqueue check, Vitest for the dialog warning and row chip, a review server, and verify-pos doctor --task task-0429 plus the stock-file and order-entry flows with --attach.

5. Migration list (slice A)

# Migration Databases
M0 ADD COLUMN IF NOT EXISTS umrp_price numeric (nullable) on every table in StockFactory.stock_tables (all at once, since warehouse copy checks column counts), plus the same column in the warehouseinfo.rb new-stock-table template Standard and Family Stores (dev/review first)
— Permission overrideUmrp (seeded the way existing permissions are) Both

No other tables. map_price is untouched.

6. Decisions (approved by Phil, 2026-10-10 12:13 PM MT, all as recommended)

  1. Per-item UMRP lives in a umrp_price stock column now. An effective-dated table comes later only if needed.
  2. Pricing dialog: block without overrideUmrp; with it, warn and require a reason.
  3. Register: warning only in this slice.
  4. Warn at equal (informational) and below.
  5. The register check uses the net unit price per each, after line discount (coupon allocation comes in a later slice).
  6. Coupon capping for UMRP lines is approved for a later slice (not slice A).
  7. Bundles: check each component line, no block.
  8. Customer-specific prices and price codes below UMRP: warn when saved (later slice), and list them in reports (later).
  9. Display/demo units: a per-policy flag plus a line reason code (later, needs policies).
  10. MAP is never enforced at the register.
  11. Same code for Family Stores and Standard, with no tenant branches.
  12. UMRP comes from the vendor price-file import. AutoQuotes map_mrp_price goes into a field only per vendor policy, after a preview.
  13. overrideUmrp goes to store managers and pricing admins only.