CMT / Job Work
CMT (Cut-Make-Trim) / Job Work challans track fabric or cut pieces sent out to a tailor or job worker for stitching, embroidery, dyeing or finishing, and the finished garments received back — with a challan number, an itemised list of what was sent, and a Pending → In Progress → Completed status flow.
Overview
Each challan records the Tailor / Job Worker name and phone, an Issue Date and Expected Return Date, free-text Notes, and a system-generated Challan Number (e.g. "CMT-0001", auto-incremented per store).
A challan holds one or more line items — Product/Fabric name, SKU, Fabric (m) consumed, Colour, Job Type (Stitching, Embroidery, Dyeing, Printing, Finishing, Cutting or Other), Qty and Unit Cost — and the modal totals these into a live Total Job Cost as you fill them in.
An inline product search box in the challan form lets you type a few letters to find an existing product and click it to fill the next empty item row (or add a new row if none is empty) with that product's name and SKU, rather than typing everything by hand.
Status moves through four stages — Pending, In Progress, Completed, Cancelled — with dedicated one-click actions: Start on a Pending challan moves it to In Progress, and Receive (with a checkmark icon) on an In Progress challan moves it to Completed and auto-stamps a Completed Date.
Clicking anywhere on a challan row (outside its action buttons) expands it in place to show its full item table — Product, SKU, Fabric (m), Colour, Job Type, Qty, Unit Cost and Line Total — fetched from the server the first time it is expanded and cached in that row afterwards.
Before You Start
- No plan-tier restriction beyond the route's "inventory" feature gate.
- Only the Tailor / Job Worker name and at least one item with a Product / Fabric name are required to save a challan — dates, phone and notes are all optional.
- The product search box requires the main Products list to have matching entries; it is a convenience only — items can also be typed in freehand without picking a product.
Step-by-Step Guide
1 Send fabric or cut pieces to a tailor
- Click New Challan.
- Enter Tailor / Job Worker * (required), Phone, Issue Date (defaults to today) and Expected Return Date.
- Use the product search box to find and click an existing product (fills the next empty item row), or fill item rows manually with Product / Fabric *, SKU, Fabric (m), Colour, Job Type and Qty.
- Enter a Unit Cost per item if the job-work cost is known upfront; click + Add Row for additional items.
- Check the Total Job Cost summary at the bottom, add any Notes, and click Save Challan — this generates the next Challan Number automatically (CMT-0001, CMT-0002, …) and saves it with status Pending.
2 Progress a challan through its status
- Click Start on a Pending challan once the tailor has actually begun the work — this sets status to In Progress.
- Click Receive (with the checkmark) on an In Progress challan once the finished garments come back — this sets status to Completed and automatically stamps today as the Completed Date if none is set.
3 Review and edit a challan
- Click anywhere on a challan's row (not on a button) to expand it and view its full item table, including SKU, Fabric (m), Colour, Job Type, Qty, Unit Cost and Line Total per item, plus any Notes.
- Click the edit icon to reopen the challan form pre-filled — the page fetches the challan's saved items from the server before opening the modal, so an existing item grid is never lost.
- Change any field or item row and click Save Challan — saving an edit fully replaces the item list on the server with whatever is in the grid at that moment.
4 Filter and manage challans
- Use the All / Pending / In Progress / Completed / Cancelled filter chips (each showing a live count) to narrow the list.
- Click the trash icon and confirm to permanently delete a challan — this also deletes all of its line items.
Every Field & Button, Explained
| Field / Button | What it does |
|---|---|
New Challan | Opens the blank CMT challan form. |
Challan Number | System-generated, e.g. "CMT-0001"; auto-incremented per store, not editable. |
Tailor / Job Worker * | Required name of the person or unit the work is being sent to. |
Phone | Optional contact number for the tailor/job worker. |
Issue Date / Expected Return Date | When the work was sent out and when it is expected back; both optional except Issue Date defaults to today. |
Product / Fabric * | Required per item row; the garment, fabric or component being sent for job work. |
SKU | Optional item SKU, auto-filled when picked from the product search box. |
Fabric (m) | Optional metres of fabric associated with that item. |
Colour | Optional colour of the item/fabric. |
Job Type | Stitching, Embroidery, Dyeing, Printing, Finishing, Cutting, or Other. |
Qty | Number of pieces/units of that item sent for job work. |
Unit Cost | Job-work cost per unit for that item; combines with Qty to compute the item's Line Total and the challan-wide Total Job Cost. |
Product search box | Type to search the Products list; clicking a result fills the next empty item row (or adds a new row) with that product's name and SKU. |
+ Add Row | Adds a new blank item row to the challan. |
Total Job Cost | Live sum of Unit Cost × Qty across all items in the form. |
Notes | Free-text notes on the challan. |
Status chips (All/Pending/In Progress/Completed/Cancelled) | Filter the challan list; each chip shows a live count. |
Start button | Only shown on Pending challans; moves status to In Progress. |
Receive button | Only shown on In Progress challans; moves status to Completed and stamps Completed Date if unset. |
Expand/collapse row | Click a challan row to load and show its saved item table with per-item Line Totals. |
Edit / Delete icons | Edit reopens the form with items pre-loaded from the server; Delete removes the challan and all its items after confirmation. |
Tips & Best Practices
- Fill in Unit Cost at the time of sending, not just on return — it makes the Total Job Cost useful for budgeting rather than only a receipt-time afterthought.
- Use the product search box instead of typing product names freehand where possible — it keeps SKUs consistent with your actual Products list for later reconciliation.
- Move challans to In Progress as soon as the tailor confirms they have started — an accurate Pending vs. In Progress split is what makes the status filter chips useful for tracking outstanding job work at a glance.
Troubleshooting & FAQ
I edited a challan and some items disappeared.
The Challan Number sequence has a gap or doesn't start at 0001 for a new store.
I can't find the "Receive" button on a challan.
The product search box shows no results.
🧑💻 Developer Notes
Source component(s):
frontend-app/pos-app-garment/src/pages/garment/CMTChallanPage.jsx
Backend endpoints used:
GET /garment/cmt-challansPOST /garment/cmt-challansGET /garment/cmt-challans/:idPUT /garment/cmt-challans/:idDELETE /garment/cmt-challans/:idPOST /garment/cmt-challans/:id/itemsPUT /garment/cmt-challans/:id/items/:itemIdDELETE /garment/cmt-challans/:id/items/:itemId
Related tables (db-core repositories):
CMTChallanCMTChallanItem
Redux slices:
None — local component state only
Feature flag key: inventory
Challan Number generation (packages/pos-core/src/garment.js createCMTChallan) computes MAX(CAST(REPLACE(challanNumber,'CMT-','') AS INTEGER)) per tenant and adds one — safe under normal use but note it is not wrapped in a transaction/lock, so two challans created in the same instant under high concurrency could theoretically race for the same number; low risk given this is a manual, single-shop workflow. The single-item endpoints (POST/PUT/DELETE .../items[/:itemId]) exist on the backend and in pos-core (addCMTChallanItem/updateCMTChallanItem/deleteCMTChallanItem) but this page never calls them — CMTChallanPage always saves the entire items array through the challan's own PUT, and updateCMTChallan (garment.js) special-cases an `items` array in the request body by deleting all existing CMTChallanItem rows for that challan and re-inserting the submitted list, with an explicit code comment explaining this is intentional so edited/removed rows are never silently kept. That makes the granular item endpoints effectively dead code from this UI's perspective — they would only be exercised by a different client calling the API directly.