# New features: order page, customers, designs, printouts

Tests: `tests/Feature/OrderPageRedesignTest.php` (17 tests). Visual check: light and dark at 1366×768 and 390×844 on the 2-year test data.

| # | Feature | Where | Why (audit ID) | How it was tested |
|---|---------|-------|----------------|-------------------|
| 1 | Item × stage grid: rows = items (lot sub-rows only when an item has 2+ lots), columns = every stage used by the order's items in merged route order, sticky item column, "N here" header counts, tick / circle / dash / boxed current cell with person, vendor or variant and days in state | `resources/views/components/stage-grid.blade.php` (+ `stage-grid-cells.blade.php`), data from `App\Support\StageGrid` | Order stages; OP-1, OP-6, OP-8, OP-11 | Tests "builds the grid…", "colours the current cell…", "shows a vendor stage…"; visual |
| 2 | Current-cell colours by the shared definitions: in progress (in_progress) blue, at vendor (sent_out) violet, taken-not-started grey solid, waiting grey dashed, on hold amber; red when waiting MORE THAN `ageing_warn_days` or a vendor send-out is past its expected date | `StageGrid::cell()` | OP-9, Order stages › symbols | Test "colours the current cell…" |
| 3 | Side panel (slide-over) for a lot: where it is now, actions, full trail with who/when, qty ok/rejected, skipped and sent-back attempts; opens from a cell or a row; Esc / backdrop closes | `view-panel.blade.php`, `ViewOrder::openLot()/closePanel()` | OP-1, OP-8, OP-10 | Test "opens the side panel…"; visual incl. modal over panel |
| 4 | New lot actions on the order page: Take, Done, Send to vendor, Receive (same workflow classes TakeStage / CompleteStage / VendorWork, same forms as the work queue, same department rule) | `ViewOrder::takeAction/completeAction/sendOutAction/receiveAction` | Order stages (panel actions) | Tests "takes, completes…", "splits a lot and sends…", "does not let a person take work of another department…" |
| 5 | Existing Hold / Release / Send back / Split now grey 32 px buttons (44 px on phones) in the panel; colour only on the confirm button | `ViewOrder::panelButton()` | OP-10 | Tests above; visual |
| 6 | "Merge lots" shown on the item row when two lots wait at the same stage (computed from loaded data) | grid item cell | (kept) | ScreensTest "offers merge…" |
| 7 | One-line header: ‹ Orders · order no. · customer (link to customer page) · status · "Late N d" · Rush | `view-header.blade.php`, `ViewOrder::getHeading()` | OP-2 | Test "renders the order page…" |
| 8 | Summary strip: customer + tap-to-call phone (WhatsApp link on phones), Received + "Entered by X" (department on hover), Due, Priority only if not Normal, Items, Qty per unit, "Dispatched x of y" items | `view-summary.blade.php` | OP-3, OP-4, OP-5 | Test "renders the order page…"; visual |
| 9 | Item status badge only for On hold, At vendor, Ready / Part dispatched, Dispatched, Cancelled | `StageGrid::itemBadge()` | OP-7 | Test "shows a vendor stage…" |
| 10 | Item heading "1 · REF · name · qty", 32 px thumbnail (placeholder icon when none), note icon with the instructions on hover | grid item cell | OP-13 | Test (instructions visible); visual |
| 11 | Legend behind a "?" popover beside the grid heading | grid header | OP-12 | Test "renders…" (sees "What the symbols mean") |
| 12 | Discussion log: "No notes yet" one line, "Add note" button in the card header; right column sticky when there is room, otherwise below the grid (container query) | `view.blade.php` | OP-14 | Test + visual |
| 13 | History grouped by day, "Show all" after 10; adds stage completions and dispatches that were never written to the timeline (older/imported data) | `App\Support\OrderHistory` | OP-15 | Tests "adds stage completions…", "logs and shows completions…" |
| 14 | Header: Dispatch is the only filled (primary) button; "Priority & due date"; More menu in groups with a divider before Cancel; Print group (Order sheet, Job cards, Completion summary) | `ViewOrder::getHeaderActions()` | OP-16, PRINT-5 | Test "offers the printouts…" |
| 15 | Add note modal: "Save note", item placeholder "Whole order", Ctrl+Enter (⌘+Enter) saves | `ViewOrder::commentAction()` | OP-17 | Browser check (Ctrl+Enter saved a note) |
| 16 | Phone layout: item list with route-line dots and current stage, tap opens the panel (full width); 44 px header and panel buttons | grid (md:hidden list) | OP-18 | Visual 390×844 |
| 17 | Order sheet PDF (any time) with order facts, items, totals and the black-and-white grid; `?cards=1` prints one job card per item with its grid and route table (done by / date / qty ok) | `App\Http\Controllers\OrderSheetController`, `pdf/order-sheet.blade.php`, `pdf/_stage-grid.blade.php` | PRINT-5, Order stages › print | Test "prints an order sheet and job cards…" (HTML + PDF) |
| 18 | Print header from Settings: company name, address, GSTIN, phone, logo (keys `company_address`, `company_gstin`, `company_phone`, `company_logo`; absent ones are left out) | `App\Support\PdfDocument::company()`, `pdf/_header.blade.php` | PRINT-1 | Test sets address + GSTIN and sees them |
| 19 | Completion summary: due, closed and "On time" / "N days late"; empty columns dropped; Rejected column; totals row; header repeated on each page; rows never split; one line per dispatch ("N items · qty") with a compact per-item line; "Handed to" hidden when empty; footer "Printed on … by …" and "Page x of y" | `OrderSummaryController`, `pdf/order-summary.blade.php`, `PdfDocument::stream()` | PRINT-1…PRINT-4 | Test "prints a fuller completion summary…" (HTML + PDF) |
| 20 | Customer page: details, contact people, orders (open first, then newest, filter open/closed), "Repeat last order", Edit in the header | `Customers/Pages/ViewCustomer.php`, `RelationManagers/OrdersRelationManager.php` | CUST-7 | Test "shows a customer page…" |
| 21 | Customers list: A–Z default sort; Open / Late / Orders / Last order right-aligned (SQL counts); Open and Late open the Orders list filtered by customer (`?tab=open|late&filters[customer_id][value]=ID`); grey type text, "Platform"; phone "94473 59963" tap-to-call, "–" when empty; Active column removed, inactive hidden by default with an "Inactive" filter and a grey badge; City filter; grey row menu | `CustomerResource::table()` | CUST-2…CUST-6, CUST-8, CUST-9 | Test "lists customers A–Z…" |
| 22 | New customer as a side panel: "New customer" / "Save customer" / "Save and add another"; no Active toggle on create; "+ Add contact person" with a help line; phone and GSTIN checks (GSTIN stored upper-case); city suggestions | `CustomerResource::form()`, `ManageCustomers` | CUST-10 | Test "formats phones… validates phone and GST…" |
| 23 | Designs list: 32 px thumbnail or placeholder icon, 3× preview on hover; Times ordered, Last ordered, Open orders (opens a list of those orders), Customer (when only one customer has ordered it); default sort last ordered then newest; first/last page links; "4 of 6 stages" with a bar and a Complete / Partial / None filter; "Ref or name" search; inactive hidden by default; grey row menu | `DesignResource::table()`, `withUsage()` | DES-2…DES-9 | Test "shows design usage…" |
| 24 | New design panel: "New design", next ref pre-filled (D-05001), unit filled from the product type, grey "From the product type" placeholder, hint before a type is picked, no Active on create, 96 px image picker beside Ref and Name, "Save design" / "Save and add another" | `DesignResource::formFields()`, `ManageDesigns` | DES-10, DES-11 | Test (nextRef); visual |
| 25 | Phone helper (format, tel:, WhatsApp, validation) | `App\Support\Phone` | OP-5, CUST-6, CUST-10 | Test "formats phones…" |
| 26 | In-progress cells: days in red when in progress longer than 2 × waiting limit, or longer than the limit on an order past due (box stays blue); side panel single spacing around "·"; phone route line uses ticks for done; history "1 item" / "3 items" | `StageGrid` (`slow`, `orderLate`), `stage-grid(-cells)`, `view-panel`, `OrderHistory::plural()` | QA Y-7 | Pest; visual |
| 27 | Customers: Open count neutral (Late red only > 0); instant filters with grey "Clear all"; customer page dates left-aligned; orders search "Order no. or ref" (ref searchable); delete asks "Delete Moti Arts 60? This cannot be undone." | `CustomerResource`, `OrdersRelationManager`, `SafeDelete::make()` | QA Y-9 | Pest (delete heading); visual |
| 28 | Designs: "Open orders" count neutral (was brand orange; type chips already grey) | `DesignResource` | QA Y-10 | Visual |
