fix(manufacturing): exclude corrective job cards from semi-FG aggregate

(cherry picked from commit bde118e7cf)
This commit is contained in:
Mihir Kandoi
2026-07-28 11:09:36 +05:30
committed by Mergify
parent c411b8e471
commit ebc8482310

View File

@@ -990,13 +990,12 @@ class JobCard(Document):
"work_order": self.work_order,
"operation_id": self.operation_id,
"docstatus": 1,
"is_corrective_job_card": 0,
},
fields=["manufactured_qty", "total_completed_qty"],
)
completed_qty = sum(
max(flt(row.manufactured_qty), flt(row.total_completed_qty)) for row in job_cards
)
completed_qty = sum(max(flt(row.manufactured_qty), flt(row.total_completed_qty)) for row in job_cards)
frappe.db.set_value("Work Order Operation", self.operation_id, "completed_qty", completed_qty)
if (