Skip to content

Commit

Permalink
feat: Tick on checkbox to include draft timesheets (#36577)
Browse files Browse the repository at this point in the history
feat: Tick on Check box to include Draft Timesheets
  • Loading branch information
viralkansodiya committed Aug 14, 2023
1 parent e023e33 commit 7565279
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions erpnext/projects/report/billing_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
]
}

0 comments on commit 7565279

Please sign in to comment.