-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: report Timesheet Billing Summary (#37451)
- Loading branch information
1 parent
7e67d42
commit c5f5aa8
Showing
12 changed files
with
232 additions
and
302 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
erpnext/projects/report/employee_billing_summary/employee_billing_summary.js
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
erpnext/projects/report/employee_billing_summary/employee_billing_summary.json
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
erpnext/projects/report/employee_billing_summary/employee_billing_summary.py
This file was deleted.
Oops, something went wrong.
Empty file.
34 changes: 0 additions & 34 deletions
34
erpnext/projects/report/project_billing_summary/project_billing_summary.js
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
erpnext/projects/report/project_billing_summary/project_billing_summary.py
This file was deleted.
Oops, something went wrong.
File renamed without changes.
67 changes: 67 additions & 0 deletions
67
erpnext/projects/report/timesheet_billing_summary/timesheet_billing_summary.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.query_reports["Timesheet Billing Summary"] = { | ||
tree: true, | ||
initial_depth: 0, | ||
filters: [ | ||
{ | ||
fieldname: "employee", | ||
label: __("Employee"), | ||
fieldtype: "Link", | ||
options: "Employee", | ||
on_change: function (report) { | ||
unset_group_by(report, "employee"); | ||
}, | ||
}, | ||
{ | ||
fieldname: "project", | ||
label: __("Project"), | ||
fieldtype: "Link", | ||
options: "Project", | ||
on_change: function (report) { | ||
unset_group_by(report, "project"); | ||
}, | ||
}, | ||
{ | ||
fieldname: "from_date", | ||
label: __("From Date"), | ||
fieldtype: "Date", | ||
default: frappe.datetime.add_months( | ||
frappe.datetime.month_start(), | ||
-1 | ||
), | ||
}, | ||
{ | ||
fieldname: "to_date", | ||
label: __("To Date"), | ||
fieldtype: "Date", | ||
default: frappe.datetime.add_days( | ||
frappe.datetime.month_start(), | ||
-1 | ||
), | ||
}, | ||
{ // NOTE: `update_group_by_options` expects this filter to be the fifth in the list | ||
fieldname: "group_by", | ||
label: __("Group By"), | ||
fieldtype: "Select", | ||
options: [ | ||
"", | ||
{ value: "employee", label: __("Employee") }, | ||
{ value: "project", label: __("Project") }, | ||
{ value: "date", label: __("Start Date") }, | ||
], | ||
}, | ||
{ | ||
fieldname: "include_draft_timesheets", | ||
label: __("Include Timesheets in Draft Status"), | ||
fieldtype: "Check", | ||
}, | ||
], | ||
}; | ||
|
||
function unset_group_by(report, fieldname) { | ||
if (report.get_filter_value(fieldname) && report.get_filter_value("group_by") == fieldname) { | ||
report.set_filter_value("group_by", ""); | ||
} | ||
} |
Oops, something went wrong.