LiveView for creating and editing transfers (stock moved between two warehouses).
Handles:
:new— creates a draft (no locations, no lines) and push_navigateto :edit path. Immediate-draft pattern, like Internal Orders.:edit— loads an existing transfer; :general tab.:items— lines editor (transfer_quantity editable in draft only —once shipped the goods have physically left, so lines become read-only).:files— MediaBrowser; storage folder resolved asynchronously.:comments— transfer comments thread.
Status lifecycle: draft -> in_transit -> done, with a side cancelled
status reachable from draft (no stock postings) or in_transit (reverses
the ship posting, crediting stock back to the source). See
PhoenixKitWarehouse.Transfers for the posting mechanics.
Structurally a copy of InternalOrderFormLive (admin-chrome pattern:
use PhoenixKitWeb, :live_view + <.admin_page_header>, no self-wrap, no
streams), with two differences of substance:
- Two
<select>s (source/destination warehouse) instead of one, editable only whilestatus == "draft". - No "import lines from a source" flow — a transfer has no natural upstream
document to pull required quantities from, so lines only ever come from
the catalogue "Add item" picker. The upstream
source_refstraceability link (viaPhoenixKitWarehouse.SourceKinds) is still manual-link-only, reusing the same picker component in its "link" mode.
All navigation paths wrapped in PhoenixKit.Utils.Routes.path/1.