Skip to content

Purchase Orders — Release Notes v1.0

Purchase Orders — Release Notes

Release date: 15 June 2026 Version: 1.0 Status: Live in production


What this release is

A polish-and-power pass over Purchase Orders in the warehouse module: a redesigned list, view, create/edit, and bulk-import experience, a clearer status model, a new Send / Download to supplier flow, and — the headline — demand projection that suggests what to buy using the same sales velocity as the Demand Forecast engine.

New Features

  • Demand projection (forecasting-powered). In the Create / Edit PO screen, Projection mode now sources each product’s sales velocity (SV) from the shared generate_demand_forecast engine (sv_xyz_merged, XYZ-weighted 7/30/90-day windows) and suggests ceil(SV × Desired Inventory Days − available stock), applying the quantities to the order. A new SV /day column shows the basis.
  • Project across multiple stores and warehouses. Two multi-selects let you combine demand; SV and on-hand stock are summed across the chosen scope.
  • Send to Supplier. A new dialog sends a PO via WhatsApp (a wa.me click-to-chat with the PO PDF as a link — no store WhatsApp number required) and/or Email.
  • Download PO. A one-click supplier-PO PDF download from the row actions.
  • KPI strip on the list: Open POs · Awaiting Approval · In-Transit Value · Monthly Spend. The tiles follow the active store/warehouse/supplier and date-range filters, so they reflect the period you’re looking at (the spend tile reads Selected range then); with no date range they cover the full in-scope dataset (spend = This month).
  • Lifecycle timeline on the View screen: Draft → Pending Approval → Approved → Completed.

Improvements

  • Unified status pills (dot + soft label) across the list and View, with one consistent palette.
  • Cleaner list matching the design system — uppercase grouped columns, supplier initials, grouped Store/Warehouse and Order/Required dates, and redesigned pagination.
  • Amounts show thousand separators and are centered under the column.
  • Status filtering simplified to a single Status dropdown (the redundant tabs were removed).
  • Inline status editor restyled and streamlined — status changes are now direct, one-click actions, so Save and approve takes two clicks (open the editor → the action) instead of four. A Pending Approval PO can be Approved directly, and the single-click Cancel is confirmed first.
  • Form spacing and the dense line-item table polished to the design.
  • Editable line pricing. Discount % and Purchase Rate on each PO line are now editable and two-way synced — change one and the other re-derives, with discount, tax, totals, and margin recalculated. The Purchase Rate field shows long values in full.
  • Cleaner WhatsApp message — the PO document link now sits under a readable call-to-action line.

Bug Fixes

  • Filter conflict that could make a saved draft “disappear” (and the Approved view show nothing) when the tab and status filters disagreed — removed at the source.
  • Number inputs no longer keep a stuck leading 0 (typing 3 gave 03); fields start empty.
  • Clearing a line-item quantity no longer deletes the row — only the × removes a line.
  • Net margin now follows the pharmacy convention (trade margin + supplier discount %, additive) instead of compounding on the discounted landing cost — e.g. a 5% line on a 15% trade margin now reads 20%, not 19.25%. Shared logic in src/lib/wms/poPricing.ts, used by the line-item table and purchase-history dialog.

Changed

  • “Sent” is no longer a workflow status. Sending a PO is an action, not a lifecycle state, so it doesn’t change status. Legacy sent POs still render correctly. The unused partially_canceled and rejected statuses and all “Return to Draft” transitions were removed.

Known Issues / Notes

  • Only products with sales velocity are suggested in projection (new SKUs have none, by design). Well-stocked products suggest 0 until their cover falls below your DIDs target.
  • Demand projection treats the selected warehouses as standalone (Case 1) and uses the forecast engine’s default windows.
  • Guide screenshots are pending a live-capture pass; the prose guides are complete.