From 87b39f045ce2aedf0687fae355e1d14b965c58b8 Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Sun, 27 Nov 2022 16:39:32 +0530 Subject: [PATCH 1/4] fix: company name with `,` in `Work Order Summary Report` --- .../report/work_order_summary/work_order_summary.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/report/work_order_summary/work_order_summary.py b/erpnext/manufacturing/report/work_order_summary/work_order_summary.py index 41ffcbb1904..b69ad070e16 100644 --- a/erpnext/manufacturing/report/work_order_summary/work_order_summary.py +++ b/erpnext/manufacturing/report/work_order_summary/work_order_summary.py @@ -39,10 +39,14 @@ def get_data(filters): "lead_time", ] - for field in ["sales_order", "production_item", "status", "company"]: + for field in ["sales_order", "production_item"]: if filters.get(field): query_filters[field] = ("in", filters.get(field)) + for field in ["status", "company"]: + if filters.get(field): + query_filters[field] = filters.get(field) + query_filters["planned_start_date"] = (">=", filters.get("from_date")) query_filters["planned_end_date"] = ("<=", filters.get("to_date")) From 2e4f3e9317917dfadb3f90bb38f548f329c96025 Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Sun, 27 Nov 2022 16:54:53 +0530 Subject: [PATCH 2/4] fix: `Work Order` filter typo in `Job Card Summary Report` --- .../report/job_card_summary/job_card_summary.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/manufacturing/report/job_card_summary/job_card_summary.js b/erpnext/manufacturing/report/job_card_summary/job_card_summary.js index cb771e49941..782ce8110a8 100644 --- a/erpnext/manufacturing/report/job_card_summary/job_card_summary.js +++ b/erpnext/manufacturing/report/job_card_summary/job_card_summary.js @@ -54,11 +54,11 @@ frappe.query_reports["Job Card Summary"] = { options: ["", "Open", "Work In Progress", "Completed", "On Hold"] }, { - label: __("Sales Orders"), - fieldname: "sales_order", + label: __("Work Orders"), + fieldname: "work_order", fieldtype: "MultiSelectList", get_data: function(txt) { - return frappe.db.get_link_options('Sales Order', txt); + return frappe.db.get_link_options('Work Order', txt); } }, { From 481149814e4170e970a9e74aaa41968cf47b7526 Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Sun, 27 Nov 2022 16:55:45 +0530 Subject: [PATCH 3/4] fix: company name with `,` in `Job Card Summary Report` --- .../report/job_card_summary/job_card_summary.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/report/job_card_summary/job_card_summary.py b/erpnext/manufacturing/report/job_card_summary/job_card_summary.py index 63c2d97d574..f867a758828 100644 --- a/erpnext/manufacturing/report/job_card_summary/job_card_summary.py +++ b/erpnext/manufacturing/report/job_card_summary/job_card_summary.py @@ -36,10 +36,14 @@ def get_data(filters): "total_time_in_mins", ] - for field in ["work_order", "workstation", "operation", "status", "company"]: + for field in ["work_order"]: if filters.get(field): query_filters[field] = ("in", filters.get(field)) + for field in ["workstation", "operation", "status", "company"]: + if filters.get(field): + query_filters[field] = filters.get(field) + data = frappe.get_all("Job Card", fields=fields, filters=query_filters) if not data: From ef7fd670fcbe3b5c0ea776bfd54f73e34d57509f Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Sun, 27 Nov 2022 16:57:38 +0530 Subject: [PATCH 4/4] fix: `production_item` filter in `Job Card Summary Report` --- .../manufacturing/report/job_card_summary/job_card_summary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/report/job_card_summary/job_card_summary.py b/erpnext/manufacturing/report/job_card_summary/job_card_summary.py index f867a758828..8d72ef1f36f 100644 --- a/erpnext/manufacturing/report/job_card_summary/job_card_summary.py +++ b/erpnext/manufacturing/report/job_card_summary/job_card_summary.py @@ -36,7 +36,7 @@ def get_data(filters): "total_time_in_mins", ] - for field in ["work_order"]: + for field in ["work_order", "production_item"]: if filters.get(field): query_filters[field] = ("in", filters.get(field))