Skip to content

Commit

Permalink
feat: report Timesheet Billing Summary (#37451)
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra authored Nov 1, 2023
1 parent 7e67d42 commit c5f5aa8
Show file tree
Hide file tree
Showing 12 changed files with 232 additions and 302 deletions.
155 changes: 0 additions & 155 deletions erpnext/projects/report/billing_summary.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

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", "");
}
}
Loading

0 comments on commit c5f5aa8

Please sign in to comment.