Skip to content

Warehouse 0.1.0: Stock, stocktakes, receipts, issues and orders for PhoenixKit

Warehouse 0.1.0 is the first release of the PhoenixKit stock module. It adds a Warehouse section to the admin where staff keep stock of catalogue items and change it through documents: stocktakes, goods receipts, goods issues, internal orders and supplier orders.

Stock and stocktakes

The stock page lists every catalogue item with its quantity, in a Grouped tree by catalogue and category or a Flat table. A Stocktake opens a count sheet of the items. Staff type in what they counted, optionally with values when Track value is on, and Conduct sets the stock to the counted numbers. A conducted stocktake is read-only, though an administrator can correct and re-conduct it.

Receipts, issues and orders

A Goods Receipt adds stock and a Goods Issue takes it off. A goods issue cannot take more than the warehouse holds. Each posted line records the quantity it replaced, so the change can be traced. A goods receipt made from a supplier order can take all the ordered quantities in one click with Receive all ordered.

An Internal Order records what is needed. Once conducted, it can Generate supplier orders for the missing quantities, grouped by supplier, or Issue to production as a goods issue. Quantities already requested are netted out so they are not ordered twice. An app can register its own “source” records, such as its own customer orders, to link to these documents through config :phoenix_kit_warehouse, source_kinds: [...].

Lists, files and comments

Every document type has a list with sortable, filterable columns that each user can choose and order. Documents have a Files tab for attachments and a comment thread when the Comments module is on, and changes are written to the activity log. The settings page picks the Warehouse location type and the Default warehouse from the Locations module.

Installing

Add {:phoenix_kit_warehouse, "~> 0.1"} to your app’s dependencies and run mix phoenix_kit.update. The module needs PhoenixKit core 1.7.182 or later, whose migration V140 creates the warehouse tables, and the Catalogue and Locations modules switched on. Then enable Warehouse under Admin → Modules. Two known limits in this release: a stocktake posted after other stock movements overwrites them with its counts, and importing the same internal order into a second supplier order can order the same quantity twice.

Full release notes: Warehouse 0.1.0

0.1.0 · 10 July 2026

Initial release.

Added

  • Inventory & stock: Stock balances per item/location, StockLedger context (upsert/receive/issue with an atomic, non-negative-guarded conditional decrement), and stocktakes (InventoryDocument) that count and post adjustments.
  • Goods receipts & goods issues: transactional posting (Ecto.Multi + FOR UPDATE compare-and-swap on status) that additively increases (receipts) or conditionally decreases (issues) warehouse stock, with a per-line previous_quantity audit trail.
  • Supplier orders & internal orders: draft → posted document lifecycle, many-to-many traceability via a generic source_refs / SourceKinds registry (host apps can register their own linkable “order” kinds), committed-quantity netting to avoid re-ordering already-requested stock.
  • Admin UI: index + form LiveViews for every document type, a shared ColumnConfig engine (sortable/filterable/configurable columns, per-user view persistence), file attachments via StorageFolders, and comments via PhoenixKitComments (optional — degrades gracefully when absent).
  • Activity logging, i18n (en/et/ru), and the PhoenixKit.Module admin-tab integration (module_key: "warehouse").
  • Project scaffold: mix.exs (with the pk_dep/3 helper, quality / quality.ci / precommit aliases, and dialyzer config), config/, .formatter.exs, .credo.exs, .gitignore, LICENSE, and AGENTS.md.

Requires

  • phoenix_kit >= 1.7.182 — the warehouse DB tables ship in core migration V140, first published in that core release.

Known issues

See dev_docs/pull_requests/2026/1-warehouse-module/CLAUDE_REVIEW.md for the full review. Notably: stocktake posting can clobber stock movements that happened between opening the count and posting it (absolute-SET semantics), and “Generate supplier orders” doesn’t record source_refs, so re-importing the same internal order into a second supplier order can double the ordered quantity. Both need a maintainer decision on intended semantics before being fixed.


Warehouse 0.1.0. Install or update: {:phoenix_kit_warehouse, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.