From 75652799cd0e5b5e44dbcc418ee623d61adbaaa1 Mon Sep 17 00:00:00 2001 From: ViralKansodiya <141210323+viralkansodiya@users.noreply.github.com> Date: Mon, 14 Aug 2023 14:14:49 +0530 Subject: [PATCH] feat: Tick on checkbox to include draft timesheets (#36577) feat: Tick on Check box to include Draft Timesheets --- erpnext/projects/report/billing_summary.py | 6 ++++-- .../employee_billing_summary/employee_billing_summary.js | 5 +++++ .../project_billing_summary/project_billing_summary.js | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/erpnext/projects/report/billing_summary.py b/erpnext/projects/report/billing_summary.py index bc8f2afb8c..ac1524a49d 100644 --- a/erpnext/projects/report/billing_summary.py +++ b/erpnext/projects/report/billing_summary.py @@ -98,9 +98,11 @@ def get_timesheets(filters): record_filters = [ ["start_date", "<=", filters.to_date], ["end_date", ">=", filters.from_date], - ["docstatus", "=", 1], ] - + if not filters.get("include_draft_timesheets"): + record_filters.append(["docstatus", "=", 1]) + else: + record_filters.append(["docstatus", "!=", 2]) if "employee" in filters: record_filters.append(["employee", "=", filters.employee]) diff --git a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.js b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.js index 8566b1fc78..2c25465a61 100644 --- a/erpnext/projects/report/employee_billing_summary/employee_billing_summary.js +++ b/erpnext/projects/report/employee_billing_summary/employee_billing_summary.js @@ -25,5 +25,10 @@ frappe.query_reports["Employee Billing Summary"] = { default: frappe.datetime.add_days(frappe.datetime.month_start(), -1), reqd: 1 }, + { + fieldname:"include_draft_timesheets", + label: __("Include Timesheets in Draft Status"), + fieldtype: "Check", + }, ] } diff --git a/erpnext/projects/report/project_billing_summary/project_billing_summary.js b/erpnext/projects/report/project_billing_summary/project_billing_summary.js index 0242036dc7..fce0c68f11 100644 --- a/erpnext/projects/report/project_billing_summary/project_billing_summary.js +++ b/erpnext/projects/report/project_billing_summary/project_billing_summary.js @@ -25,5 +25,10 @@ frappe.query_reports["Project Billing Summary"] = { default: frappe.datetime.add_days(frappe.datetime.month_start(),-1), reqd: 1 }, + { + fieldname:"include_draft_timesheets", + label: __("Include Timesheets in Draft Status"), + fieldtype: "Check", + }, ] }