From fc4ac7a4418a4692b9929f4a596817c817b7050c Mon Sep 17 00:00:00 2001 From: Sudharsanan11 Date: Tue, 14 Jul 2026 13:23:28 +0530 Subject: [PATCH] fix(manufacturing): preserve job card transferred quantity (cherry picked from commit d7e9321746c04f405d8766e542f3fdbe57acb473) --- erpnext/manufacturing/doctype/work_order/work_order.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/manufacturing/doctype/work_order/work_order.py b/erpnext/manufacturing/doctype/work_order/work_order.py index dd5c07c2945..c28e0054c99 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order.py +++ b/erpnext/manufacturing/doctype/work_order/work_order.py @@ -1275,6 +1275,10 @@ class WorkOrder(Document): def recompute_material_transferred_for_manufacturing(self, transferred_items): """Set material_transferred_for_manufacturing based on actual item-level transfers, not fg_completed_qty.""" + # Job Card transfers use the minimum completed quantity across operations. + if self.operations and self.transfer_material_against == "Job Card": + return + # When fg_completed_qty > 0 (direct stock entries, excess transfer), preserve the # SUM(fg_completed_qty) approach so excess-transfer tracking works correctly. sum_fg_completed_qty = self.get_transferred_or_manufactured_qty("Material Transfer for Manufacture")