Delivery Challans
What it is
Two panels side by side:
- 🚚 Generated Challans — every challan issued, newest first, with its status and delivery tracking.
- 📄 Create DC from Invoice — recent invoices with an Issue DC button beside each.
Who can open it
Any signed-in staff account that is active. Two gates, both in proxy.ts: account status, then
the ops.dispatch feature grant while FEATURE_GRANULAR_RBAC is on, with the owner bypassing.
ops.dispatch also covers /dispatch, /packing-lists, /shipping-bills and /delivery-notes —
there is no grant specific to challans.
Before you start
Both panels are scoped to the entity you currently have selected, and both do that filtering after fetching, which has two visible consequences:
- 🔴 The challan list can show fewer rows than a page holds, or none at all, while the pager still counts every entity's challans. If a page looks short or empty but the pager says there are more, the missing rows belong to other entities. The empty state says so explicitly: "No delivery challans for the active entity. N exist for other entities — switch entity in the top bar to see them."
- ⚠️ The "Create DC from Invoice" panel only ever considers the 20 most recent invoices across
all entities, then filters those to your entity. An older invoice will never appear there.
To raise a challan against one, open the invoice and use its 🚚 Challan button, or go
straight to
/delivery-challans/create?invoice=<id>.
Every control on the page
Header: View Invoices, which goes to the invoice list.
🚚 Generated Challans:
| Control | What it does |
|---|---|
| Search | Matches the DC number or the invoice number. |
| DC Number | Opens the challan. |
| Client | From the linked invoice. Reads Unknown if the customer cannot be resolved. |
| DC Status | Edited in place: Draft, Dispatched, Delivered, Cancelled, Cancelled (Post-Invoice). |
| Tracking | The e-POD's state, or No tracking when no delivery note exists. |
| 🔗 | Copies the e-POD link to the clipboard. Only shown when the challan's invoice has a delivery note. |
| Row menu | View / Edit / Delete, plus 📊 Excel. |
| Paging | Only appears when there are more challans than fit one page. |
🔒 Status locks once a challan is Cancelled or Cancelled (Post-Invoice). Draft, Dispatched and Delivered all remain editable.
📄 Create DC from Invoice — each row shows the invoice number and its customer, with Issue DC opening the create screen pre-filled from that invoice.
What it writes
| Action | What it writes |
|---|---|
| DC Status (inline) | PATCH to the challan's API route. A failure reloads the list and reports why. |
| Delete (row menu) | Asks first, then deletes the delivery_challans row. |
| 🔗 | Copies to the clipboard; writes nothing. |
| 📊 Excel | Downloads a workbook from the server; writes nothing. |
| Issue DC | Navigates only — the challan is created on the create screen. |
When it goes wrong
The list looks empty but you know challans exist. They belong to another entity. Switch entity in the top bar — the empty state tells you how many are elsewhere.
A page shows only two or three rows. Same cause: the page is filled from all entities and then filtered down to yours.
An invoice is missing from "Create DC from Invoice". Only the 20 most recent are offered. Start from the invoice itself instead.
The DC status will not change. The challan is cancelled; that state is final on this screen.
There is no 🔗 button on a row. That challan's invoice has no delivery note, so there is no e-POD link to copy. Generate one from the invoice.
Client reads "Unknown". The challan's invoice could not be matched to a customer — usually because the challan was raised against a purchase order rather than an invoice.
Related screens
- Delivery Challans — Create — issuing a challan.
- Delivery Challans — Id — one challan.
- Invoices — Id — the 🚚 Challan button, and where e-PODs are generated.