[Proposal] Overtime Feature

As we know Overtime Feature is one of the requirements by our ERPNext Community.
I have also done some research regarding this feature and here are some basic findings and designs to work on.

Policy and Purpose:

Purpose:

To compensate employees for hours worked beyond their standard schedule.

Policy:

This company overtime policy won’t contradict any legal guidelines provided by local, state, or federal law.

Policy Elements(To be covered):

  • Minimum and Maximum Hours Limit: The Minimum and Maximum hours limit parameter will be added to avoid a decline in work quality or other issues due to excessive working hours.

  • exempt or non-exempt Employee: We’ll classify our employees as exempt or non-exempt according to overtime pay laws. Non-exempt employees are workers who are entitled to earn the federal minimum wage and qualify for overtime pay.

  • Age Restriction: There will also be some age restrictions based on which there will be a proper validation.

Design:

As per my research, I came up with this design. ​

Options to be added in HR Settings:

  • Overtime Based On(Select): There will be two option for calculating overtime pay

    • Timesheet: The employee will post the timesheet manually based on which Overtime pay will be calculated during payroll.
    • Attendance: Based on entry and exit time, Which will be mapped in the Attendance document.
  • Overtime Minimum Limit.

  • Overtime Maximum Limit.

  • Minimum Age limit for Overtime.

Options to be added in Salary Structure:

  • Overtime salary Component (Select): Earning component which will reflect overtime pay in Salary slip

  • Overtime Rate Calculation Based On(Select):

    • Formula: As per design can write formula.
      example: rate = 1.5 * net_pay * overtime_hours
    • Rate: You can also define standard numerical rate for overtime pay calculation

Changes in time sheet:

Is Overtime(checkbox) will be added in the Timesheet document, will be shown if Overtime is based on a timesheet. The employee will post their timesheet for their overtime hours.

Workflow:

There will be two workflows for Overtime.
  1. Workflow Based on Timesheet(Manually):

    • For this there should be a default shift in Employee Master or there should be a shift assignment document for Employee.
    • The employee will fill their timesheet and get it approved by Hr manager for overtime pay calculation.
    • After proper Approval of Hr manager, During the Payroll all Timesheet will be fetched in salary slip and overtime hours will be calculated accordingly.
    • Based on hours and rate/formula the overtime pay will be calculated and will be reflected by salary component selected in salary structure for overtime, in Earnings Table.
  2. Workflow Based on Attendance(Automated):

    • Default shift or shift Assignment should be there.
    • There is Auto Attendance feature already present in ERPNext. which automatically creates attendance based on employee check-ins(Fetched from biometric devices) and shift type.
    • Based on entry and exit time of employee in Attendance Document the overtime hours and overtime pay will be calculated during payroll and will be reflected in the Earnings table.

These are some basic design patterns and workflow ideas, I propose based on my research. Please, provide us with some enhancements suggestions, or ideas to improve the current workflow.

13 Likes

How is this design taking care of logic where multiplier for over-time would vary for the same Employee, based on a weekday (1.25%), weekend (1.5%) or public holiday (2%)?

I Will request the community to validate if this use-case is valid and pretty frequent. Or it’s flat multiplier can be defined on destination/grade level?

4 Likes

Even though each grade level may have flat multiplier, the multiplier still varies per week day, weekend and holiday within same grade level.So let this be factored in the design.

2 Likes

I have required Feature of Workflow Based on Attendance (Automated)
It should configurable of Lunch hours i.e excluded or included based on shift allocated.

  • There should be a Lunch Hours Excluded or include while counting Overtime with auto attendance feature.
  • In default shift setting Lunch Hours setting should required.

@Fred1 Will cover this use-case too…

@Pritesh_Patel, The shift time is defined in DocType Shift Type. So, The Overtime hours will be calculated and will be compensated to employees for hours worked beyond their standard schedule(shift timing) excluding lunch hours. Will provide a different setting or option to cover this use case too.

We had a requirement once which defined OT to be paid only for the work hours on week off and holidays. The rate was decided based on No. of hours of OT i.e, half-day rate & full-day rate irrespective of an employee grade.

Location Based allowance was also required. Like On-Site and Off-Site location based timesheet entries.

1 Like

If we give provision based on working, weekoff and day in Holiday list, then it this use-case will be taken care I guess. You can keep OT multiplier on working day to zero. For for other multiplier, we already have a feature of Timesheet wise salary component… If there is another edge case, then I believe Additional Salary Component can be used.

@winter_wolf since this feature revolves mostly around hours etc. Perhaps it will be better it’s tracked in attendance, where we can update total hours worked (synced from Employee Checkin) or manually update. And then, we can take a sum of Attendance of that Employee for a month in Salary Component.

There could also be an intermediate document which calculates over-time based on the different multiplier for each Employee, and then Additional Salary is created for from there for OT.

Cc: @nabin @pateljannat

4 Likes

In addition to overtime after a number of hours in a day which your proposal already covers, there needs to be a provision to cover overtime due to the number of hours worked in a week. In the US we are required to pay overtime after a given number of non-overtime hours in a week, and care must be taken that overtime is not double counted by the two conditions, i.e. there is no “pyramid,” or piling premium compensation on top of premium compensation.

The most common US overtime rules are:

  • 1.5x after 8 hours in a day

  • 2x after 12 hours in a day

    and

  • 1.5x after 40 regular, non-overtime hours in a week

    and

  • 1.5x on the 7th working day in a week

With the weekly overtime, only standard hours are counted, those that have been paid at the daily overtime or double time are not allowed to do ‘double duty’ and create weekly overtime. As an example imagine a person who works four 10 hour days (8 regular hours, 2 OT hours), and then comes in for a regular 8 hour shift. Although more than 40 total hours have elapsed in the week, some were already paid at the OT rate and so the entire 8 hour shift is regular time.

2 Likes

One more point for workflow based on attendance (Automated)
Implementation of buffer time before and after duty can configurable in shift.

For example according to my company’s rules the reporting time is 8 a.m. but if the person checks in 15 minutes early to his reporting (considering 15 mins as buffer), then that should not be counted towards his overtime, while calculating his working hours, start time is still kept at 8 a.m. regardless of his check in time. Although if he checks earlier than buffer time, for example at 7:30 am, he gets Overtime from check in till his reporting, i.e. the full half hour and NOT only 15 mins. The same goes for or the end time for example, if I keep a buffer of 30 minutes after the shift ends and if the shift ends at 6:00 p.m. then the person checking out at 6:30 would still be counted in his working shift. however if the person lives at 6:31 pm then the full over time after the duty time, which is 6 p.m., should be counted hence the overtime becomes 31 minutes.

Example : SHIFT SETUP - For Over Time

Shift Type - GEN

Shift Start Time - 8:00 | Lunch Start Time - 13:00

Shift End Time- 16:30 | Lunch Duration - 00:30

Shift Hours- 8:00 | Lunch End time - 13:30

Overtime Start Before Shift time = 00:30

Overtime Start After Shift time = 00:30

Overtime Deduction- If Late Entry then shift time & If Early Left then shift time

For Example :

Overtime = Working hours - shift hours

Lunch hours should not be count in shift hours or It may be optional based on company policy

Overtime can start after shift end time hours can be configurable

Overtime can start before shift start time hours can be configurable

Total working hours should not be more then 24 hours a day

Maximum allowed over time can configurable

Hi,

im quite interesting on this…

in my country the overtime will need to be able to calculate :

  1. the break time should not be calculated
  2. there is different rates for , first 2 hour on working days is 150% , and the rest of it is 200% for that day… and for weekend / holiday it is 200% hourly

so i think we need day by day overtime , to be able to clasified it…maybe we can make 2 columns for categorizing this… so in salary slip the number of hours will be on 2 different variable

1 Like

Generic Feature requirement:

  1. Good to capture the per day overtime in Attendance DocType.
  2. Working hours calculation in Attendance DocType can also be verified. Consider a scenario an employee creates a Attendance doc type and multipel IN and OUT with Employee Checkin. The working works (Attendance Doc Type) calculation from Multiple CheckIN and CheckOut in associated Employee CheckIN doctype can also be linked.
  3. Minimum work hour per day for attendance should also be applicable on Daily basis

UAE perspective request the following usecase to be considered:
In the SME sector the calculation of the overtime is on a per day basis as an employee in a production setup can work 12 hours a day and come an one or two late the next day (because of which the work hours the next days is less than the required work hours) .
In such scenario the attendance approval will be at the level of HR managers

Working Hours and OT in brief should be calculated on Daily , Weekly or Monthly Basic.
Because there might be scenario where employees will be eligible for daily OT but not weekly or monthly OT.

Please contact hello@3qspace.io for any pre production validation and test support.

I would like to share my experience with overtime which I worked on a while back.

  1. I used designation to determine whether the employee is eligible for overtime, and I added a default working hours in the company profile.

  2. From the biometric device employee checkin was being populated, while generating Auto Attendance based on the employee shift, if the employees working hours are above the default total working hours and is eligible for overtime, in the attendance document it would flag the attendance with ‘has overtime’ and a field to capture overtime in hours. I also added a provision to enter overtime in hours manually (allow on submit, only allowed for HR) incase there was any discrepancies with system data and foreman/supervisors data

  3. While Payroll Entry was prepared for the company, it would compute the total overtime hours from the attendance for each respective employee and create additional salaries for the employee who have attendances with overtime.

The Challenges I faced:

  • Since lunch break option is not available in erpnext. I had configured the shift type with determine checkin and checkout alternating entries as in and out during the same shift and working hours calculation is based on every valid check-in and check-out and added two more fields in attendance to capture the 2nd and 3rd checkin of the day (in an ideal scenario there should be 4 employee checkin for any given day which includes one lunch break in between) so that it is possible to view all the 4 timestamps from employee checkins in the attendance document.

  • Calculating overtime on weekends, I could have used timesheets, but I had to create a salary structure for each employee seemed too cumbersome as per hour rate was different for each employee, so I decided to base it on employee checkin from the biometric device, had to add a custom app to run a custom logic to avoid altering the core erpnext code.

  • The biometric device was very basic had issues with sensitivity, so instead of 4 employee checkin for the day there would be more (not too many but enough to mess up everything). There were entries which were less than 4 secs apart so had to add a provision to flag skip attendance on employee checkin data from the same employee under x seconds which could be configured.

Based on what is discussed above

Workflow Based on Timesheet(Manually):

  • For this there should be a default shift in Employee Master or there should be a shift assignment document for Employee.
  • The employee will fill their timesheet and get it approved by Hr manager for overtime pay calculation.
  • After proper Approval of Hr manager, During the Payroll all Timesheet will be fetched in salary slip and overtime hours will be calculated accordingly.

Probably add a provision to add a interim approver like Foreman / Supervisor / Accounts to validate the timesheets

Workflow Based on Attendance(Automated):

  • Default shift or shift Assignment should be there.
  • There is Auto Attendance feature already present in ERPNext. which automatically creates attendance based on employee check-ins(Fetched from biometric devices) and shift type.
  • Based on entry and exit time of employee in Attendance Document the overtime hours and overtime pay will be calculated during payroll and will be reflected in the Earnings table.

currently if the employee works on a weekend based on the set default holiday list in the employee profile, the employee checkins are ignored as it is a holiday. Attendance needs to marked manually but that does not trigger the calculation of working hours. It would be nice if this could be configurable

Additionally, an option to view overtime hours in salary slip, like leave balance in v13.

This might go beyond the scope of overtime, but since there is work being done on compensating an employee on working extra hours, maybe build functions in a manner it could also be used to penalize employees who do not clock the total working hours in a day :grin:

2 Likes

The Working Hours calculation in the Attendance DocType is based on the Shift List Doctype

Presently if multiple Check IN and CheckOUTs are associated with a Attendance DocType and on Submit of teh Attendance doctype the working hours is not updated.

We should decouple Shift and working hours calculation.
Working Hours also can be based on the associated CheckIN and CheckOUT (Probably we can enable a CHECK option to pick working hours from Employee CheckIN even if Shift is not selected)

This will help in non shift OT calculation

Hi , Can you pls help me with support engineer with nominal consultancy /coach fee.Aswe have already installed and testing stage . We need consultancy for our business structure of 14 branches in two states . Karnataka 10 branch and Telangana - 4 branches . With two different GST numbers .
Thanking you
Nagaraja
nagaraj@ranna.in

On the basis of above discussion, we are working on a new design and workflow. We will update on this thread after finalising the design.

1 Like

hiii @winter_wolf did you design workflow,
how to calculate overtime
if you did it
please share work flow here .
Thank you ,

Kindly, I would like to know when this update will be completed?

2 Likes

Can we calculate overtime a specific amount at certain times of the day and another amount at other times of the day، like overtime at night its different from morning can you Automated to calculate overtime like that its important to many factory