Skip to content

Purchase Orders — Release Notes v1.0.1

Purchase Orders — Release Notes

Release date: 6 July 2026
Version: 1.0.1 (WMS patch) · Ailaaj One 1.4.4.1
Status: Live in production
Applies to: Replenish Stock → Procurement → Purchase Orders (create, edit, view, print)


What this release is

Staff entering a line discount % on a new or edited PO could see the value change after tabbing away (for example 5% becoming 5.002%). Line totals, tax, and margin could also disagree between the items table, PO view, and printed PDF when a discount was applied.

This patch aligns pricing across create/edit/view/print and stops discount drift caused by the purchase-rate field round-tripping a two-decimal display value.


Bug fixes

  • Discount % drift on blur. Entering 5% discount and moving focus (especially via the Rate column) could rewrite the discount to 5.002% because the rate displays two decimals (185.11) while the exact discounted cost is 185.1075. The rate field now only back-calculates discount when the user edits the rate; discount % is stored with two-decimal rounding.
  • Line total with discount. Line totals, tax, and margin on the items table now use cost × (1 − discount%) consistently (same model as GRN), not a mismatched retail-margin path.
  • View and print parity. PO view and list print use shared helpers so amounts match the form; edit load uses the same stored-line pricing path.
  • Margin display. Net margin on PO lines shows two decimal places.

Technical notes

  • Shared pricing: src/lib/wms/poPricing.ts
  • View/print helpers: src/lib/wms/poPrintHelpers.ts
  • Tests: tests/wms/poPricing.test.ts, tests/wms/poPrintHelpers.test.ts

Known issues / notes

  • Supplier-facing print (qty-only, no pricing) is unchanged by design.