mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 16:15:02 +00:00
fix: add employee name in report data
This commit is contained in:
@@ -167,11 +167,15 @@ class EmployeeHoursReport:
|
||||
|
||||
def set_employee_department_and_name(self):
|
||||
for emp in self.stats_by_employee:
|
||||
emp_name = frappe.db.get_value(
|
||||
'Employee', emp, 'employee_name'
|
||||
)
|
||||
emp_dept = frappe.db.get_value(
|
||||
'Employee', emp, 'department'
|
||||
)
|
||||
|
||||
self.stats_by_employee[emp]['department'] = emp_dept
|
||||
self.stats_by_employee[emp]['employee_name'] = emp_name
|
||||
|
||||
def calculate_utilizations(self):
|
||||
TOTAL_HOURS = flt(self.standard_working_hours * self.day_span, 2)
|
||||
|
||||
@@ -96,6 +96,7 @@ class TestEmployeeUtilization(unittest.TestCase):
|
||||
expected_data = [
|
||||
{
|
||||
'employee': self.test_emp1,
|
||||
'employee_name': 'test1@employeeutil.com',
|
||||
'billed_hours': 5.0,
|
||||
'non_billed_hours': 0.0,
|
||||
'department': emp1_data.department,
|
||||
@@ -122,6 +123,7 @@ class TestEmployeeUtilization(unittest.TestCase):
|
||||
expected_data = [
|
||||
{
|
||||
'employee': self.test_emp2,
|
||||
'employee_name': 'test2@employeeutil.com',
|
||||
'billed_hours': 0.0,
|
||||
'non_billed_hours': 10.0,
|
||||
'department': emp2_data.department,
|
||||
@@ -173,6 +175,7 @@ class TestEmployeeUtilization(unittest.TestCase):
|
||||
return [
|
||||
{
|
||||
'employee': self.test_emp2,
|
||||
'employee_name': 'test2@employeeutil.com',
|
||||
'billed_hours': 0.0,
|
||||
'non_billed_hours': 10.0,
|
||||
'department': emp2_data.department,
|
||||
@@ -183,6 +186,7 @@ class TestEmployeeUtilization(unittest.TestCase):
|
||||
},
|
||||
{
|
||||
'employee': self.test_emp1,
|
||||
'employee_name': 'test1@employeeutil.com',
|
||||
'billed_hours': 5.0,
|
||||
'non_billed_hours': 0.0,
|
||||
'department': emp1_data.department,
|
||||
|
||||
Reference in New Issue
Block a user