Sale Orders

A sale order is a customer's order for one or more law-book Full Sets or individual monthly parts. This page explains the order's 12-state lifecycle and the two things Head Office can do to it from this console today: approve it for despatch, or cancel it.

Orders are not created here

Sale orders are captured in the Sales-Executive field app or the public API — a field executive visits a customer, builds the order, and it flows up into this console already drafted. There is no New sale order button anywhere in /staff, and the console has no create, edit or view page for orders — only a list with two row actions. The HO console's job is to review and act on orders that already exist, not to originate them.

Where to find it

Open Sales → Sale Orders in the left navigation. The link only appears if your role holds sale_order.view (or you are a super administrator).

The state machine

Every sale order sits in exactly one of 12 states. Most of the journey — from the moment a Sales Executive starts an order to the moment it is queued for Head Office — happens in the field app / API, with no console involvement. The console becomes relevant the instant an order reaches SubmittedToHo, and again at any point if the order needs to be stopped with Cancel.

State legend

StateWhat it meansWho moves it here
DraftThe order has just been started; lines can still be freely changed.Field app / API
LinesConfirmedThe customer's line items — which Full Sets or parts, and quantities — are locked in.Field app / API
PaymentPendingThe order is waiting for the customer's payment to be recorded and allocated before it can move on.Field app / API
CreditPendingThe order is being sold on credit and is waiting on a credit-limit / credit-request approval.Field app / API
DiscountPendingA discount applied to the order needs approval before the order can proceed.Field app / API
ReadyForHoAll financial clearance (payment, credit or discount, whichever applied) is done; the order is queued to be sent up to Head Office.Field app / API
SubmittedToHoThe order has reached Head Office and is waiting for a decision. This is the only state from which HO Approve is offered.Field app / API (arrives here)
ApprovedForDespatchHead Office has approved the order; it is now eligible for stock reservation and picking.ConsoleHO Approve
InDespatchStock for the order has been picked and packed, and the package is on its way to the customer.Outside console (despatch process)
CompletedThe order has finished its despatch cycle. The terminal, successful state.Outside console (despatch process)
SuspendedA held/paused state defined on the model. No action in this console currently sets or clears it.Not exposed anywhere found
CancelledThe order was cancelled. Terminal — nothing can move an order out of this state.ConsoleCancel (or field app/API)
Everything before "Submitted to HO" is Planned for this console

Drafting an order, confirming its lines, clearing payment/credit/discount, and submitting it to HO all happen in the field app or the public API — there is no console screen for any of them today. Likewise, the final leg from ApprovedForDespatch through InDespatch to Completed is not driven by any Sale Order button here; it progresses as despatch work happens elsewhere (see Picking Waves and Packages). The console's role is deliberately narrow: review an order once it reaches Head Office, and be able to stop it at any point.

What the console exposes

The Sale Orders list has exactly two row actions. Both are gated by permission and by the order's current state, and both re-check those rules on the server even if you click faster than the screen refreshes.

HO Approve

Moves an order from SubmittedToHo to ApprovedForDespatch — the moment Head Office signs off on an order so it can be reserved and picked.

  1. Find the order

    On the Sale Orders list, use the Filters panel's State filter and select SubmittedToHo to see everything waiting on your decision.

  2. Select HO Approve on the order's row

    The button only appears on rows currently in SubmittedToHo — you won't see it on any other order.

  3. Confirm

    A dialog asks you to confirm. There is nothing else to fill in.

  4. Check the result

    On success the row's State column updates to ApprovedForDespatch and the order becomes eligible to be picked into a wave.

Screenshot placeholderThe HO Approve confirmation dialog on a Sale Orders row: order reference, customer name, total amount for context, and a single confirming button.
Permissions

sale_order.approve is required to see and use HO Approve. It is a separate permission from sale_order.view — you can be able to see the list without being able to approve anything on it.

Cancel

Stops an order dead, moving it to Cancelled from whatever state it is currently in.

FieldTypeRequiredNotes
reasonTextareaYesMax 500 characters. The action will not proceed with this left blank.
  1. Select Cancel on the order's row

    Available on any order not already Completed or Cancelled — including orders still in early field-app-driven states.

  2. Type a reason

    Be specific — this text is the permanent record of why the order was stopped, and is what a colleague (or an auditor) will read later. Up to 500 characters.

  3. Confirm

    Select the confirming button in the dialog.

  4. Check the result

    The row's State updates to Cancelled. This is terminal — there is no console action to bring a cancelled order back.

Screenshot placeholderThe Cancel form dialog on a Sale Orders row: a required, multi-line "Reason" textarea (500-character limit) above the confirming button.
Cancel is broad on purpose

Because Cancel is offered from almost every state — including ones the field app manages, like Draft or PaymentPending — it is Head Office's universal "stop this order" switch, independent of how far along it is. Use it when an order should not proceed at all, not as a substitute for the earlier, field-app-driven stages this console doesn't expose.

The list

Sale Orders opens straight on its list — there is no create page (orders are placed from the field app), but each row can be opened to a read-only detail view (below). Rows sort by created_at descending by default.

ColumnShows
referenceThe order's reference number, as a badge. Searchable and sortable.
CustomerThe ordering customer's full name (via their profile).
SalespersonThe full name of the staff member credited with the order.
stateThe order's current lifecycle state, as a coloured badge (see the state legend above).
total_net_amountThe order's net value, formatted as Indian Rupees. Sortable.
order_dateThe date the order was placed. Sortable.

Filter

The Filters panel offers a single State drop-down listing all 12 states, so you can, for example, isolate everything sitting in SubmittedToHo waiting on your approval, or everything already Cancelled for an audit trail.

Screenshot placeholderThe Sale Orders list: Reference, Customer, Salesperson, State (badge), Total Net Amount and Order Date columns, with the State filter panel open showing all 12 states and the HO Approve / Cancel row actions visible on eligible rows.

Viewing an order Built

Use the View row action (or click through) to open an order's detail page — read-only, gated by the same sale_order.view permission as the list. It has two parts:

Everything here is read-only — an order is driven through its lifecycle by the HO Approve / Cancel actions and by the field app, not edited as a form. The lines you see are also what the sales reports aggregate; the payments, credit/discount requests and state history tables let you trace an order's full financial and approval history without leaving the page.

Screenshot placeholderThe Sale Order detail page: an "Order" info panel (reference, state badge, customer, salesperson, type, date), an "Amounts" panel (gross/discount/tax/net), and read-only tabs/tables below for Line items, Payments applied, Credit requests, Discount requests and State history.

Visibility scoping — you may not see every order

Unlike a flat permission check, the Sale Orders list also filters which rows you can see, on top of whether the module is visible to you at all:

Why an order you expect might be missing

If a colleague mentions an order you cannot find, it is almost always this scoping at work rather than a fault: the order's customer sits outside the region or customer scope assigned to you, and you are not its salesperson. An administrator with sale_order.view_all, or a super administrator, can always see it and can review or widen your geography/customer scope if that access is genuinely needed.

See also