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

This commit is contained in:
Mihir Kandoi
2026-07-28 11:09:36 +05:30
parent 5548f0726a
commit bde118e7cf

View File

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