Warehouse 0.2.0: Several warehouses, transfers, minimum stock and a turnover report
Warehouse 0.2.0 lets one PhoenixKit site run several warehouses: stock is kept and shown per warehouse, goods move between them with transfers, items below a minimum are flagged, and a turnover report sums up what came in and went out.
Stock per warehouse
Goods receipts, goods issues and stocktakes now have a warehouse selector on the draft. Changing the warehouse of a stocktake re-seeds its count sheet. The stock page gets a scope selector: All warehouses or one warehouse, remembered per user. It is hidden while no warehouse location type is set up.
Transfers
A new Transfers document moves goods from a Source warehouse to a Destination warehouse. A draft is shipped with Ship, which takes the stock off the source, and then shows as In transit until Receive adds it at the destination. A draft can be cancelled outright, and cancelling a transfer in transit puts the stock back at the source. A received transfer is read-only.
Minimum stock and deficits
Each item can have a minimum quantity. The stock page marks items below their minimum, and the flat table adds Min. quantity (editable in place), Available and Deficit columns, a deficit filter and a Create supplier order button on rows that fall short. Available stock is the stock on hand minus what posted documents have reserved; drafts reserve nothing. An item with no stock at all still shows as a deficit.
Turnover report
The new Turnover page shows, per item and for a date range, the Inflow, Outflow and Balance, for all warehouses or for one. The balance is the stock on hand today, not the balance at the end of the range.
Internal orders and supplier orders also list their related documents, upstream and downstream, on their cards.
Upgrading
The transfer and minimum stock tables come with PhoenixKit core’s migration, not with the module: update core and run mix phoenix_kit.update. Supplier orders generated from an internal order now read the stock of that order’s own warehouse. On a site with one warehouse nothing else changes.
Full release notes: Warehouse 0.2.0
0.2.0 · 13 July 2026
Wave 1: multi-warehouse, transfers, deficit control, turnover.
Added
- Multi-warehouse stock scope: per-location stock balances
(
StockLedger.stock_map_for_location/1,get_quantity/2), a warehouse selector on goods receipt/issue/inventory drafts, and a “per warehouse / all warehouses” scope toggle on the Stock page (persisted per user). - Transfers: new document type with a draft → in_transit → done lifecycle, atomic ship/receive stock postings, and cancellation (draft: void; in_transit: reverses the ship posting back to the source warehouse).
- Deficit control: per-item minimum stock, an available-quantity
calculation (on-hand minus posted reserves — draft documents don’t
reserve), zero-stock deficits surfaced even with no
Stockrow, and a “create supplier order” action from a deficit row. - Turnover report: aggregated in/out/balance per item over a date
range, optionally scoped to one warehouse;
balanceis documented as current on-hand, not a historical balance as of the end date. - Related documents: a shared upstream/downstream linked-documents list component on Internal Order / Supplier Order cards.
Transfer/MinStocktables now ship in corephoenix_kit‘s migration V144 instead of this package’s own migrator (which is retired); this package defines schemas only and owns no DDL.
Fixed
StockLedger.stock_map/0,Deficits,Inventories,GoodsReceipts,GoodsIssuesprevious-quantity audit snapshots, and theSourceKindslink picker in the goods receipt/issue forms were all made warehouse-aware or corrected for multi-location stock (seedev_docs/pull_requests/2026/3-wave-1-multi-warehouse/CLAUDE_REVIEW.mdfor the full list, plus this release’s own post-merge fixes below).- Post-merge review fixes:
SupplierOrders.generate_from_internal_order/2andimport_from_internal_orders/3now read on-hand stock from the internal order’s own warehouse instead of an arbitrary one;TransferFormLive’s quantity input is now clamped non-negative (a negative value could otherwise inflate source-warehouse stock and permanently stall the transfer);TurnoverReportLiveno longer queries the database inmount/3(was doubling the report query on every page load);Transfer/MinStockschemas now usePhoenixKit.SchemaPrefix, matching every other table-backed schema in this package.
Requires
phoenix_kit >= 1.7.190—Transfer/MinStocktables ship in core migration V144 (renumbered from a provisional V143 before publish; 1.7.189 tops out at V142, so it does not satisfy this pin — corrected post-release, see PR #4).
Warehouse 0.2.0. Install or update: {:phoenix_kit_warehouse, "~> 0.2"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.