Warehouse 0.2.2: Posting a goods receipt updates the stock's unit value
Warehouse 0.2.2 makes a posted goods receipt set the unit value of the stock it adds, so the stock page shows what the goods last cost.
Goods receipt lines created from a supplier order already carried the order’s price. Posting the receipt now writes that price into the stock’s unit value for the item at the receiving warehouse. The last posted receipt wins. A line without a price leaves the unit value as it was.
Supplier order generation still picks the item’s primary supplier first and the manufacturer’s suppliers second, as in 0.2.1.
Full release notes: Warehouse 0.2.2
0.2.2 · 14 July 2026
Added
- Goods receipt lines can now set stock
unit_valueon posting (PR #5). When a receipt line carries a"unit_value"field, posting writes it tophoenix_kit_warehouse_stock.unit_valuefor that item/location viaStockLedger.receive_quantity/3’s existing:unit_valueoption (last posted receipt wins). Absent/nilleaves the existing value untouched.
Fixed
resolve_suppliers/1stopped honoringitem.primary_supplier_uuid(PR #5 fix, applied during review). PR #5 rewrote supplier resolution to prefer aPhoenixKitCatalogue.Catalogue.Suppliers.primary_for_item/1junction lookup, on the premise that core’s V149 migration removed theprimary_supplier_uuidscalar. It didn’t: V149 is a purely additive per-supplier-pricing junction table, and the scalar remains the item’s documented default supplier. Against the pinnedphoenix_kit_catalogue ~> 0.10dependency,primary_for_item/1doesn’t exist, so the new code silently fell through to manufacturer-only resolution — any item that relied onprimary_supplier_uuid(generic/unbranded materials with no manufacturer, or breaking a tie between a manufacturer’s multiple linked suppliers) stopped auto-assigning a supplier duringgenerate_from_internal_order/2. Revertedresolve_suppliers/1to checkprimary_supplier_uuidfirst, manufacturer as fallback — the original pre-PR behavior. Full findings:dev_docs/pull_requests/2026/5-parties-resolver-unit-value/CLAUDE_REVIEW.md.
Warehouse 0.2.2. Install or update: {:phoenix_kit_warehouse, "~> 0.2"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.