From 260d87a80c086669324a4726b9b5797ce17a5b16 Mon Sep 17 00:00:00 2001 From: Sudharsanan11 Date: Sun, 8 Mar 2026 19:12:51 +0530 Subject: [PATCH 1/2] fix(manufacturing): show returned qty in progress bar (cherry picked from commit 8027f5aafdadd2293357f158f0610d011e51ae7e) --- .../manufacturing/doctype/work_order/work_order.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js index 971b811fbcc..a1f23e6e145 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.js +++ b/erpnext/manufacturing/doctype/work_order/work_order.js @@ -445,10 +445,21 @@ frappe.ui.form.on("Work Order", { if (pending_complete > 0) { var width = (pending_complete / frm.doc.qty) * 100 - added_min; title = __("{0} items in progress", [pending_complete]); + let progress_class = "progress-bar-warning"; + if (frm.doc.status == "Closed") { + if (frm.doc.required_items.find((d) => d.returned_qty > 0)) { + title = __("{0} items returned", [pending_complete]); + progress_class = "progress-bar-warning"; + } else { + title = __("{0} items to return", [pending_complete]); + progress_class = "progress-bar-info"; + } + } + bars.push({ title: title, width: (width > 100 ? "99.5" : width) + "%", - progress_class: "progress-bar-warning", + progress_class: progress_class, }); message = message + ". " + title; } From c572a019b4d1b3d80ad53cb27187b6942e3341f4 Mon Sep 17 00:00:00 2001 From: Sudharsanan11 Date: Sun, 8 Mar 2026 19:14:01 +0530 Subject: [PATCH 2/2] feat(manufacturing): show disassembled qty in progress bar (cherry picked from commit ae9ff767fa657e909253ff4512189c85c780b367) --- .../doctype/work_order/work_order.js | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.js b/erpnext/manufacturing/doctype/work_order/work_order.js index a1f23e6e145..b6206cefcbb 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.js +++ b/erpnext/manufacturing/doctype/work_order/work_order.js @@ -425,10 +425,11 @@ frappe.ui.form.on("Work Order", { var added_min = false; // produced qty - var title = __("{0} items produced", [frm.doc.produced_qty]); + let produced_qty = frm.doc.produced_qty - frm.doc.disassembled_qty; + var title = __("{0} items produced", [produced_qty]); bars.push({ title: title, - width: (frm.doc.produced_qty / frm.doc.qty) * 100 + "%", + width: (flt(produced_qty) / frm.doc.qty) * 100 + "%", progress_class: "progress-bar-success", }); if (bars[0].width == "0%") { @@ -464,6 +465,8 @@ frappe.ui.form.on("Work Order", { message = message + ". " + title; } } + + //process loss qty if (frm.doc.process_loss_qty) { var process_loss_width = (frm.doc.process_loss_qty / frm.doc.qty) * 100; title = __("{0} items lost during process.", [frm.doc.process_loss_qty]); @@ -474,6 +477,19 @@ frappe.ui.form.on("Work Order", { }); message = message + ". " + title; } + + // disassembled qty + if (frm.doc.disassembled_qty) { + var disassembled_width = (frm.doc.disassembled_qty / frm.doc.qty) * 100; + title = __("{0} items disassembled", [frm.doc.disassembled_qty]); + bars.push({ + title: title, + width: disassembled_width + "%", + progress_class: "progress-bar-secondary", + }); + message = message + ". " + title; + } + frm.dashboard.add_progress(__("Status"), bars, message); },