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 bc9dc7d095..2c78b3125d 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 @@ -23,7 +23,7 @@ class EmployeeHoursReport: def validate_dates(self): self.day_span = (self.to_date - self.from_date).days - if self.day_span < 0: + if self.day_span <= 0: frappe.throw(_('From Date must come before To Date')) def run(self): diff --git a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py index 5306b922eb..e01e9b1539 100644 --- a/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py +++ b/erpnext/projects/report/employee_hours_utilization_based_on_timesheet/test_employee_util.py @@ -12,8 +12,8 @@ class TestEmployeeUtilization(unittest.TestCase): @classmethod def setUpClass(cls): # Create test employee - cls.test_emp1 = make_employee("test@example.com", "_Test Company") - cls.test_emp2 = make_employee("test1@example.com", "_Test Company") + cls.test_emp1 = make_employee("test1@employeeutil.com", "_Test Company") + cls.test_emp2 = make_employee("test2@employeeutil.com", "_Test Company") # Create test project cls.test_project = make_project({"project_name": "_Test Project"}) @@ -80,7 +80,7 @@ class TestEmployeeUtilization(unittest.TestCase): expected_data = [ { - 'employee': 'EMP-00002', + 'employee': self.test_emp2, 'billed_hours': 0.0, 'non_billed_hours': 10.0, 'total_hours': 18.0, @@ -88,7 +88,7 @@ class TestEmployeeUtilization(unittest.TestCase): 'per_util': 55.56 }, { - 'employee': 'EMP-00001', + 'employee': self.test_emp1, 'billed_hours': 5.0, 'non_billed_hours': 0.0, 'total_hours': 18.0, @@ -111,7 +111,7 @@ class TestEmployeeUtilization(unittest.TestCase): expected_data = [ { - 'employee': 'EMP-00001', + 'employee': self.test_emp1, 'billed_hours': 5.0, 'non_billed_hours': 0.0, 'total_hours': 18.0, @@ -134,7 +134,7 @@ class TestEmployeeUtilization(unittest.TestCase): expected_data = [ { - 'employee': 'EMP-00002', + 'employee': self.test_emp2, 'billed_hours': 0.0, 'non_billed_hours': 10.0, 'total_hours': 18.0,