From 2a1a4723712b6cae1c15c88c3a1e3bff4f6ea7ad Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Mon, 26 Apr 2021 11:18:32 +0530 Subject: [PATCH] chore: clean-up - set default date filters for last month instead of year - added abbreviations for columns to use them in the metrics labels --- ...ee_hours_utilization_based_on_timesheet.js | 4 +-- ...ee_hours_utilization_based_on_timesheet.py | 34 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.js b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.js index b11a1fc97f..9a30b99f9b 100644 --- a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.js +++ b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.js @@ -16,14 +16,14 @@ frappe.query_reports["Employee Hours Utilization Based On Timesheet"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", - default: frappe.defaults.get_global_default("year_start_date"), + default: frappe.datetime.add_months(frappe.datetime.get_today(), -1), reqd: 1 }, { fieldname:"to_date", label: __("To Date"), fieldtype: "Date", - default: frappe.defaults.get_global_default("year_end_date"), + default: frappe.datetime.now_date(), reqd: 1 }, { diff --git a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py index 7337a03eb4..b38da1416f 100644 --- a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py +++ b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/employee_hours_utilization_based_on_timesheet.py @@ -57,34 +57,34 @@ class EmployeeHoursReport: 'options': 'Department', 'fieldname': 'department', 'fieldtype': 'Link', + 'width': 120 + }, + { + 'label': _('Total Hours (T)'), + 'fieldname': 'total_hours', + 'fieldtype': 'Float', + 'width': 120 + }, + { + 'label': _('Billed Hours (B)'), + 'fieldname': 'billed_hours', + 'fieldtype': 'Float', 'width': 170 }, { - 'label': _('Total Hours'), - 'fieldname': 'total_hours', - 'fieldtype': 'Float', - 'width': 150 - }, - { - 'label': _('Billed Hours'), - 'fieldname': 'billed_hours', - 'fieldtype': 'Float', - 'width': 150 - }, - { - 'label': _('Non-Billed Hours'), + 'label': _('Non-Billed Hours (NB)'), 'fieldname': 'non_billed_hours', 'fieldtype': 'Float', - 'width': 150 + 'width': 170 }, { - 'label': _('Untracked Hours'), + 'label': _('Untracked Hours (U)'), 'fieldname': 'untracked_hours', 'fieldtype': 'Float', - 'width': 150 + 'width': 170 }, { - 'label': _('% Utilization (Billed Hours + Non-Billed Hours / Total Hours)'), + 'label': _('% Utilization (B + NB) / T'), 'fieldname': 'per_util', 'fieldtype': 'Percentage', 'width': 200