Hi,
I am using a Timesheet based salary structure to calculate Overtime. The hours are fed into the Overtime salary component with a formula on it to calculate overtime.
However when the formula returns 0, the salary slip value defaults to hourly_rate * total_working_hours, instead of just returning 0.
Salary Structure:
Overtime Formula:
(total_working_hours - (payment_days * 8.0)) * hour_rate if total_working_hours > (payment_days * 8.0) else 1 if total_working_hours < (payment_days * 8.0) else 0
When I run the salary slip, if the formula returns 0 it should just return that, but instead it defaults to the timesheet calculation.
If I return 1 instead, it works fine.
(total_working_hours - (payment_days * 8.0)) * hour_rate if total_working_hours > (payment_days * 8.0) else 1 if total_working_hours < (payment_days * 8.0) else 1
This will return 1.
Is this a weird default? When the formula returns 0, it will go back to the timesheet calculation?