v1.19.0: receiving and putaway
Receiving and putaway
Three threads. An admin can reverse a single PO receipt (the double-scan fix) with a warehouse-pool inventory walk and a receipt.cancelled event so downstream inbound counts stay in step. The Put-Away supervisor dashboard becomes a grid of bin tiles, red when a staging bin holds work and grey when empty, so the whole staging map reads at a glance. And preferred bins are constrained to a strict, Pickable-only priority hierarchy.
Mobile. PutAwayScreen surfaces the preferred-bin rejection reason instead of swallowing it. versionCode 8 -> 9, version 1.19.0; a new APK build is owed.
Added
- Admin unreceive (#388):
record_unreceivereverses one PO receipt in a single transaction -- decrements the PO line, recomputes PO status, hard-deletes theitem_receiptsrow, writes anACTION_RECEIVE_CANCELaudit row (details.source='admin_unreceive'), and emitsreceipt.cancelled/1. Inventory backs out of the warehouse pool (preferring the original bin, then any bin holding the item) so the reversal lands even after putaway has moved the goods; refuses withinsufficient_availablewhen the warehouse total is short.GET /admin/purchase-orders/<id>/receiptsandPOST /admin/receipts/<id>/unreceive(both gated by the existingreceivingpage key), plus receipt history + a per-row Unreceive control in the admin Receiving modal. - Put-Away supervisor dashboard (#389): an auto-fill grid of bin tiles, alphabetised, red-bordered when a staging bin has items awaiting putaway and grey when empty; clicking a populated tile opens the per-item breakdown with a per-bin CSV export. The
/putaway/pendinglist now joinspreferred_binsand surfaces the same priority-1 suggested bin as the single-item suggest endpoint.
Changed
- Preferred bins: strict Pickable priority hierarchy (#390): both preferred-bin write paths (the admin POST and the putaway set-as-primary) reject any bin whose type is not Pickable. A deferrable
UNIQUE(item_id, priority)constraint plus an admin auto-resequence keep each item's bins a contiguous 1..K hierarchy. The rejection is now surfaced on the admin Preferred Bins page (as an error) and on the handheld putaway prompt.
Migrations
- 069 --
preferred_binsgains a deferrableUNIQUE(item_id, priority)constraint and drops the redundant non-unique(item_id, priority)index. Aborts if duplicate(item_id, priority)rows remain, so dedup before applying.
Upgrade notes
- Apply migration 069. Dedup any existing duplicate
(item_id, priority)preferred_binsrows first, or theADD CONSTRAINTwill abort. - Mobile: a new APK build (versionCode 9) is owed for the PutAwayScreen change; the API/admin work in this release does not require it.