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); } }, { 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..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,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", "production_item"]: 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: 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"))