# `PhoenixKitWarehouse.Web.TransferFormLive`
[🔗](https://github.com/BeamLabEU/phoenix_kit_warehouse/blob/0.4.0/lib/phoenix_kit_warehouse/web/transfer_form_live.ex#L1)

LiveView for creating and editing transfers (stock moved between two
warehouses).

Handles:
- `:new`      — creates a draft (no locations, no lines) and push_navigate
                to :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 header-breadcrumb
pattern: `use PhoenixKitWeb, :live_view` + a `self_wrapped_layout` on_mount
wrapping render/1 in `<LayoutWrapper.app_layout>`, no streams), with two
differences of substance:
- Two `<select>`s (source/destination warehouse) instead of one, editable
  only while `status == "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_refs` traceability
  link (via `PhoenixKitWarehouse.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`.

# `on_mount`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
