# Inventory & Fulfillment — Overview

_Enterprise_

Full inventory + fulfillment subsystem. Items live in bins with QR codes; vendors are tracked as manufacturers; purchase orders bring stock in; boxes pack stock out to customers; every quantity change writes an immutable stock-movement audit row. Real-time across all logged-in users, paper-trail-clean for compliance, mobile-first for the warehouse floor. Seven sub-tabs under Enterprise > Inventory: Items, Manufacturers, Bins, Purchase Orders, Boxes, Movements, Reorder.

## Steps
1. Go to Enterprise > Inventory (requires Enterprise suite). The hub renders 7 sub-tabs; switch with the URL ?sub= param or the tab strip.
2. Items tab: search, filter (category / condition / location / low-stock), bulk-import CSV, add/edit one at a time, or open an item to see its full history.
3. Manufacturers tab: vendor directory — name, email, phone, default lead time, contact notes. POs link to a manufacturer.
4. Bins tab: physical storage locations with auto-generated QR codes. Print labels and stick them on shelves; mobile scans them to receive stock fast.
5. Purchase Orders tab: create POs against a manufacturer, add line items, receive stock against lines (partial or full). Each receive writes a stock-movement row.
6. Boxes tab: outbound packing units with a state machine (open → sealed → shipped → delivered). Pack items off the warehouse floor with your phone.
7. Movements tab: immutable audit timeline of every quantity change — receives, packs, unpacks, adjustments, transfers. Filter by item, PO, box, bin, type, date range.
8. Reorder tab: items at/below their reorder point grouped by manufacturer. One click creates a PO from suggestions; another emails the report to the vendor with a PDF attached.

## Tips
- Real-time: changes propagate to all open browser tabs in your org without refresh. Receive a PO in one tab → quantities update in the other within ~500ms.
- Throttle protects you during bulk operations: 100-line PO receives + 500-row CSV imports coalesce into a single bulk-update event rather than 100 individual ones, so the UI stays smooth.
- Every quantity change writes a StockMovement audit row with type, qty, who/when, and links to the source PO / box / bin. Movements tab is the audit trail — read-only by design.
- Mobile (More tab → Inventory) is suite-gated and scan-driven. The phone is the right tool for the warehouse floor; web is the right tool for setup and reports.

## Example
A 3-location distributor tracks 8,000 SKUs across 4 warehouses. Receivers scan a bin label, then scan each item barcode on a mobile phone — no clipboard, no typing. Pickers pack outbound boxes the same way — scan to add, seal when done. The dispatcher watches the Movements tab live: she can see every receive and pack as it happens, with the user who did it. End of day: the Reorder tab surfaces 47 items below threshold grouped by 8 manufacturers; she clicks "Email Report" on three and is done in 90 seconds.

## Troubleshooting
- **Inventory tab shows "Suite not active"** — Inventory ships under the Enterprise suite. Without Enterprise active on your org, the API rejects /enterprise/inventory calls with 403. Fix: Settings > Billing > Suite Add-ons — toggle Enterprise on (Pro+ plans) or upgrade to Max which includes it. Enterprise also unlocks territories, multi-currency, CPQ, SSO/SAML, and custom SLA.
- **Mobile inventory section missing from More tab** — Mobile gates the section on the Enterprise suite via /sidebar-context. If the suite was activated after you logged into mobile, the cached suite list may be stale. Fix: Pull-to-refresh on the More tab, or sign out and back in. The gate flips on within seconds of activation.
- **Bulk-import fails or imports fewer rows than expected** — CSV format mismatch (missing required columns like name + quantity), invalid numeric values, or the file exceeded the row cap. Fix: Download the template from the bulk-import dialog, paste rows into the correct columns, save as UTF-8 CSV, re-upload. Required columns are name and quantity; everything else is optional.
- **Quantity changed but my screen still shows the old number** — Real-time updates require an active socket. If the tab was backgrounded long enough for the socket to disconnect (1-2 minutes), it will auto-reconnect on focus. Fix: Tab refocus reconnects automatically. If quantities still look stale, manually refresh once — auto-invalidation only re-runs queries that are actively mounted.

## Plans
Enterprise suite required (Max plan includes it; Pro can add it for $50/mo).
