Surface complete order context (status, totals, shipping, deposits) so ops staff can reconcile and act without leaving the page.
Provide inline controls for recording payments/refunds and refreshing the payment ledger.
Data & Dependencies
Loads order detail and line items via ordersService.get(orderId, token); responses include payment summary, deposit ledger, and shipping metadata.
Records payments/refunds through ordersService.recordPayment(orderId, payload, token) and refreshes the ledger via ordersService.getPayments when requested.
Reuses locale-based currency formatting from client settings (currencySymbol from the order payload).
When an order references a brewery group, fetches membership context via groupsService.get(groupId, token) and routes hub actions through ordersService.claimGroup, ordersService.transferGroup, and ordersService.releaseGroup.
Key Interactions
Header breadcrumbs and the Documents menu surface full-screen previews: selecting the invoice or delivery note triggers the respective /orders/:id/{invoice|delivery-note} endpoints, regenerates branding-aware PDFs, stores them in Spaces, and streams them into the dialog with Print / Send / Download actions; the labels action still shows a placeholder until its generator lands.
Summary cards show client info, dispatch state, payments, and deposit balances, and expose the same editable status/dispatch pills as the orders list (reverting to Draft surfaces a confirmation warning).
The Group collaboration card (visible when order.groupId is populated) summarises hub status, region, delivery window, and active member counts, and exposes “Claim shipping”, “Transfer hub”, and “Release hub” controls. Claim and release target the current team; transfer opens a picker of eligible active members (excluding the current hub). All actions trigger snackbars and refresh the group detail.
Items card lists every line (including multipacks, services, and single containers) with unit prices and totals. “Add beer” opens the picker for in-stock multipacks and single containers, pre-filling the line form while keeping quantity, pricing, tax, and the free-text unit label editable. “Add other” launches the custom charge form for services like delivery or glassware, capturing description, unit label, price, and optional fixed/percentage discounts before recalculating totals.
Line item defaults honour the client’s assigned pricebook—multipack overrides and single-container prices use the matching pricebook entry when present, falling back to manual entry only when no price is defined.
Editing line items is limited to orders in the Draft state; confirmed orders prompt a confirmation dialog before allowing add/edit/remove operations.
Payment ledger table lists chronological entries with method, reference, signed amount, and running balance; “Refresh” re-pulls the ledger without reloading the page.
“Add payment” opens the payment dialog (amount, kind, method, reference, deposit credit) and displays snackbars on success/failure.