Skip to main content

Delivery Challans — Create

What it is

Issues a delivery challan against an invoice, a purchase order, or both. The lines are pre-filled from whichever you came in with, you adjust the quantities actually being delivered, and finalising allocates the challan number and creates the e-POD tracking record.

You normally arrive here from the invoice's 🚚 Challan button or from Issue DC on the challan list, which puts ?invoice=<id> in the address.

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.

Before you start

🔴 The variance rules have a gap that can trap you. When a line came from a purchase order, the delivered quantity is compared with the ordered quantity:

Difference from orderedWhat happens
up to 5%Fine, no action.
over 5% and up to 25%A warning pill, and an Approve button you can use to record the variance.
over 25%Saving is refused, and the message reads "One or more items have a BLOCK variance. Approve or correct before saving."

At over 25% there is no Approve button — it is only offered in the 5–25% band. So despite what the message says, the only way past a block is to correct the quantity. If you genuinely need to deliver more than 25% off the ordered amount, split it across challans or amend the purchase order first.

⚠️ The save is not one transaction. The challan header is written first, then its lines. If the lines fail you get "Delivery challan created but items failed" and are left with an empty challan. Open it and add the lines rather than starting again, which would burn a second challan number.

A line with no description is dropped on save — an empty row you added never reaches the challan.

Every control on the page

Top bar:

ControlWhat it does
← BackReturns to the challan list. Nothing is saved.
📊 Excel DraftGreyed out. Its tooltip says "Save DC first to export as Excel" — export from the saved challan.
Print DraftPrints the draft as it stands.
✓ Finalize Delivery ChallanAllocates the number and creates everything.

Link Purchase Order (optional) — pick a PO to link. Its items are pre-filled and, once linked, the note reads "PO <number> linked — items pre-filled from this PO. Adjust quantities as needed." Linking a PO is what switches the variance checking on; without one there is no ordered quantity to compare against and no line is ever blocked.

Source Invoice — shown when you came from an invoice: the invoice number and the customer.

Line items — number, Description (fixed), Remarks (free text), unit, and Quantity (editable). On PO-linked lines a variance pill sits under the quantity, with the Approve button beside it in the 5–25% band. Approving opens a dialog showing the ordered and delivered quantities and the difference, and records the approval against that line.

Lines can also carry a revised unit price with a reason; the price override is only stored when the line is actually marked as revised.

What it writes

Finalising, in order:

  1. Allocates the challan number through next_dc_number for the entity. If that fails, nothing is created and you are told why.
  2. Inserts the delivery_challans header, linked to the invoice and/or the purchase order.
  3. Inserts the delivery_challan_items — description, quantity, unit, remarks, the PO line it came from, the ordered quantity, and any price override with its reason.
  4. Inserts a delivery_notes row in pending state, so the delivery can be signed for. This step soft-fails: if it does not work the challan still exists and you are told "Delivery Challan <number> created, but e-POD tracking record failed".

You are then taken to the new challan. Only invoice-linked challans get an e-POD record — a PO-only challan has nothing to sign against.

When it goes wrong

"Select an invoice or a purchase order." The screen has nothing to build from. Start from the invoice, or link a PO.

"One or more items have a BLOCK variance." A line is more than 25% off the ordered quantity and cannot be approved from here. Correct the quantity — see "Before you start".

"Failed to allocate DC number." Nothing was created; it is safe to try again.

"Delivery challan created but items failed." The challan exists with no lines. Open it and add them — do not finalise again.

"...but e-POD tracking record failed." The challan is fine. Generate the e-POD from the invoice instead.

No variance pills anywhere. No purchase order is linked, so there is no ordered quantity to compare against.

📊 Excel Draft will not click. It is disabled until the challan is saved.