mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-11 05:31:48 +00:00
fix(manufacturing): exclude corrective job cards from semi-FG aggregate
(cherry picked from commit bde118e7cf)
This commit is contained in:
@@ -990,13 +990,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 (
|
||||||
|
|||||||
Reference in New Issue
Block a user