Hi Danial, my bad, I misunderstood what you were after at first. I read “charge the cost to scrap” as writing it off to an expense, but you want the cost to stay in stock on the scrap gel. You’re right, Material Issue doesn’t do that.
So I went back to my test site (ERPNext 16.34, synthetic data, numbers in VND with a dot as the thousands separator) and tried to rebuild your case as closely as I could: BOM with Track Semi Finished Goods, a first-stage gel operation, a batch-tracked raw material, and since it’s pharma I assumed you run a Quality Inspection on the gel, so the first-stage Job Card has an In Process QI marked Rejected.
1. The QI blocks the Job Card
With the default Stock Settings (Action if Quality Inspection is rejected = Stop), the Job Card can’t be submitted once its QI is rejected
So anything that goes through the Job Card and the semi-finished Manufacture entry is closed off. That’s another reason the “complete 1 and delete the row” trick feels wrong.
2. What worked: Repack straight out of WIP
Setup once: a scrap item (I used “Gel - rejected”, batch-tracked) and a warehouse like “QC Rejected”.
Then for the rejected batch, one Stock Entry of type Repack:
- source rows: the raw materials that were transferred to WIP for this batch (here 2 kg of the active ingredient from batch API-00001, plus 8 kg gelatin)
- target row: the scrap item into QC Rejected
- Additional Costs tab: the operating cost of the gel step, if you want that on the scrap too (I put 1 h on the mixing vessel = 500.000)
Repack values the output at the cost of what it consumed plus the additional costs. So the scrap gel came in at 3.600.000 of materials + 500.000 operating cost = 4.100.000. The consumed raw-material batch was picked automatically (FIFO), and the scrap item got its own new batch:
3. What it does to the GL
The raw-material part posted nothing, because WIP and QC Rejected use the same stock account on my site. If yours use different stock accounts you’ll see a stock-to-stock movement, still nothing on adjustment or expense.
The operating cost part posts Dr stock / Cr the account you choose in Additional Costs:
That’s the same treatment a normal Manufacture entry gives operating cost. I’d use your company’s Default Operating Cost Account there, so it lands where your regular production does (on my test company that was empty, so I used Expenses Included In Valuation).
4. Closing it out
Stop the Work Order so the next operation doesn’t wait for the gel. The first-stage Job Card stays a draft, with the operator’s time log and the rejected QI linked, and I put the WO, Job Card and QI numbers in the Repack remarks. That gave me a clean trail from the QI to the scrap batch.
If you’d rather go through a real Manufacture entry
That works too, but only after you change that Stock Setting to Warn. Then the Job Card submits with a warning. Set its Target Warehouse to QC Rejected first, and the Manufacture entry puts the gel there with its full cost (raw materials and operating cost from the Job Card). A Repack then turns the gel into the scrap item:
I tested that path as well, but the setting is global, so it also turns the QI block into a warning for receipts and deliveries. The Job Card will also show the batch as completed. That’s why I’d go with the Repack from WIP.
About the Actual Time table
You’re right, and it looks intentional in the code rather than a bug. The time log row only has Completed Qty. Pending and Process Loss live on the Job Card itself, and you can only set them from the Complete Job dialog or the Pending Qty field, which won’t take a value until something is completed. So a 100% loss can’t go in through the table. For pharma and food that’s a real gap, and I think a GitHub issue would be worth it.
When you move to 16.50, have a look at the Complete Job dialog first. In the latest v16 code, Completed Quantity isn’t mandatory there anymore and the Process Loss you type is kept, so Completed 0 + Process Loss = full batch might work directly. I haven’t tested that version myself though, and with a rejected QI the Job Card submit could still be blocked by the Stop setting.
Hope this is closer to what you need. Try it on a copy of your site first, since I’ve only checked it on 16.34.