fix: Handle overtime edge case
This commit is contained in:
parent
40abd2a2e1
commit
ccb15de1c9
@ -134,6 +134,11 @@ class EmployeeHoursReport:
|
||||
for emp, data in iteritems(self.stats_by_employee):
|
||||
data['total_hours'] = TOTAL_HOURS
|
||||
data['untracked_hours'] = flt(TOTAL_HOURS - data['billed_hours'] - data['non_billed_hours'], 2)
|
||||
|
||||
# To handle overtime edge-case
|
||||
if data['untracked_hours'] < 0:
|
||||
data['untracked_hours'] = 0.0
|
||||
|
||||
data['per_util'] = flt(((data['billed_hours'] + data['non_billed_hours']) / TOTAL_HOURS) * 100, 2)
|
||||
|
||||
def generate_report_summary(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user