Where to enter employee overtime entry in payroll ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Hello Sugumar,
To determine the hourly wage for a contract, divide the contract's wage by 30 and the number of hours per day in the contract's resource calendar.
contract.wage/30/contract.resource_calendar_id.hours_per_day
To calculate the total overtime worked by an employee, use the "employee.total_overtime" field.
If you want to calculate overtime pay for a specific pay period, you can use the following code:
- Start with a variable "overtime" set to 0.
- Loop through each overtime record for the employee using "employee.overtime_ids".
- If the date of the overtime record falls within the date range of the payslip, add the duration of the overtime to the "overtime" variable.
- Calculate the overtime pay by multiplying the "overtime" variable with the hourly rate calculated earlier.
Here is the source:
overtime = 0
for line in employee.overtime_ids:
if payslip.date_from <= line.date <= payslip.date_to:
overtime+= line.duration
result = (contract.wage/30/contract.resource_calendar_id.hours_per_day)*(overtime)
I hope this information is helpful to you.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up