feat: time tracking in minutes
This commit is contained in:
@@ -170,7 +170,7 @@ class PayrollService(BaseService):
|
||||
def get_amount(
|
||||
self,
|
||||
user: User,
|
||||
work_units: int
|
||||
work_units: float
|
||||
):
|
||||
pay_rate: PayRate = user.pay_rate
|
||||
overtime_threshold = 0
|
||||
@@ -185,7 +185,7 @@ class PayrollService(BaseService):
|
||||
base_units = work_units
|
||||
overtime_units = 0
|
||||
else:
|
||||
overtime_units = max(0, work_units - overtime_threshold)
|
||||
overtime_units = max(0.0, work_units - overtime_threshold)
|
||||
base_units = work_units - overtime_units
|
||||
|
||||
return pay_rate.base_rate * base_units + overtime_rate * overtime_units
|
||||
|
||||
Reference in New Issue
Block a user