fix(manufacturing): preserve job card transferred quantity

This commit is contained in:
Sudharsanan11
2026-07-13 18:53:19 +05:30
parent 9c353741ad
commit 951e432a1b

View File

@@ -161,6 +161,10 @@ class RequiredItemsService:
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.doc.operations and self.doc.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 = StatusService(self.doc).get_transferred_or_manufactured_qty(