Daily Overtime 24 Hour Rule

Class Name

com.wbiag.app.ta.quickrules.DailyOvertime24HourRule

JSP: /quickrules/qDailyOvertime24HrParams.jsp

Overview

The Daily Overtime 24 Hour Rule applies daily overtime based on a dynamically determined 24-hour range. You configure when the 24-hour period starts, based on:

  • A specified start time that is defined either in the rule's parameters or an emp_val field.
  • An algorithm that compares the start time of the current day's first eligible work detail record to the first eligible work detail record of the previous day. If the gap between the two work detail records is greater than 24 hours, the start time of the current day's first eligible work detail record is used. Otherwise, the rule continues to look back until a day off or a gap of greater than 24 hours between eligible work details is found. For a work detail to be eligible, the work detail must have an eligible hour type, which are defined in the Eligible Hour Types parameter.
  • The start time of the first eligible work detail of the previous day. If there are no eligible work details on the previous day, then the start time of the first eligible work detail of the current day is used. For a work detail to be eligible, the work detail must have an eligible hour type, which are defined in the Eligible Hour Types parameter.

Since the work details before, during, or after the 24-hour period may occur during different conditions, such as on holidays, weekends, or regular work days, the rule should be configured to run three times to cover each possibility:

  • One instance of the rule is configured to calculate overtime for work details that occur before the 24-hour period.
  • One instance calculates overtime for work details that occur during the 24-hour period.
  • One instance calculates overtime that occurs after the 24-hour period.

Each instance should have a condition set for each circumstance that could occur and affect how overtime is paid. For example, if the details for paying overtime on a weekend are different than on a regular workday, you would configure two condition sets: one for when the work details occur on a weekend and one for when the work details occur on a regular work day.

Note: The Daily Overtime 24 Hour Rule must be used in combination with the Split Detail Rule. Configure the processing order of the rules so that the Split Detail Rule runs at the end of each run cycle, followed by the Daily Overtime 24 Hour Rule. See Building rules.

Parameters

Parameters marked with an asterisk (*) are required.

Parameter Description
*Hour Set Description This parameter defines under what conditions employees earn overtime. The parameter specifies how many hours an employee must work at their regular hour type before earning overtime.

Specify a comma-delimited list of tokens. Each token consists of an hour type and duration in minutes in this format: HTYPE=#, HTYPE=#.

For example, specify REG=600,OT1=9999 to configure the rule to assign the OT1 overtime rate after the employee works 600 minutes. The rule assigns the REG rate to the first 600 minutes employees work and then the OT1 rate to any time worked after that.

You can specify several tokens in a list to configure the rule to assign different rates when the amount of time employees work in the day reach different thresholds. For example, you can assign overtime after employees work more than 10 hours and double-overtime after employees work more than 14 hours.

Add Premium For First Hourtype Select this check box to add a premium to the first hour type token (as defined in the Hour Set Description parameter). The rule creates a premium for the first hour type token when employees earn overtime.
Work Detail Time Codes Specify a comma-separated list of time codes that mark time which counts toward earning overtime. The rule includes work details with one of the specified time codes toward the conditions that are specified in the Hour Set Description parameter.
Eligible Hour Types Specify a comma-separated list of hour types that mark time which counts toward earning overtime. The rule includes work details with one of the specified hour types toward the conditions that are specified in the Hour Set Description parameter.

By default, the value is REG.

Premium Time Codes Counted Specify a comma-separated list of premium time codes that count towards overtime. For example, if holidays are paid as premiums, specify the time code that is used by the holiday premium so that time employees work on holidays counts toward overtime.
Discount Time Codes Specify a comma-separated list of time codes that count towards employees earning overtime, but are not paid at the overtime rate, such as the SICK time code.

Work details that are marked with one of the specified time codes are discounted or subtracted from the total amount of time employees must work before earning overtime.

For example, if employees earn overtime after working 9 hours a day, but an employee records 3 hours of work details with a discount time code, the employee will earn overtime after working 6 hours.

If the code is included in the Hour Set Description list in the hour set, the code will get paid and the time will be discounted. Choosing one or the other is important to guarantee proper behavior.

Premium Time Code Inserted This parameter controls how the rule pays overtime. The parameter can either perform the hour type betterment, which changes the hour type of the work details considered overtime (according to the conditions in the Hour Set Description parameter) so the employee receives a higher rate, or the rule inserts a premium for any overtime employees earn.

By default, this parameter is null and the rule assigns overtime by changing the hour type of work details to an appropriate rate, as defined by the Hour Set Description parameter. For example, if the parameter is REG=540,OT1=9999, employees who record more than 540 minutes of eligible work details earn overtime. The hour types of eligible work details above 540 minutes are converted to the OT1 hour type and the employee is paid a higher rate.

Specify a premium time code to configure the rule to insert a premium for any overtime earned, instead of updating the work detail with the appropriate rate. For example, if a time code named DOT has been set up in the application for the overtime premium, specifying DOT inserts a premium with the DOT time code. The length of the premium equals the amount of overtime the employee earned, according to the conditions in the Hour Set Description parameter. If the parameter is REG=540,OT1=9999, employees who record more than 540 minutes of eligible work details earn overtime. The amount of overtime equals the length of eligible work details above 540. An employee that works 600 minutes earns 60 minutes of overtime, and the rule creates a premium that is 60 minutes in length. When the rule is configured to insert a premium, the rule does not change the hour types of overtime work details.

Hour type For Overtime Work Details Specify the hour type of the overtime work details if the rule inserts a premium. This parameter is used only when a time code is specified in the Premium Time Code Inserted parameter. The hour type marks the work details that produce overtime premiums so that they can be:
  • Excluded/included in other overtime rules.
  • Distinguished as details that produced the overtime.
*24 Hour Start Time This parameter defines the start of the 24-hour time period the rule examines when determining if employees earn overtime.

This parameter accepts one of these values:

  • Specify the time of day in the format YYYYMMDD HHMMSS. The parameter ignores the specified date and checks only the time portion of the string so that 19000101 can be used in all cases, followed by a space, and the time you want the 24-hour time period to start. For example, specify 19000101 050000 to start the 24-hour time period at 5:00.
  • Specify the employee value field in the application that defines the time, in the format emp_valX, where X is the number of the emp_val field. Emp_val1..20 can be used. The time that is specified in the specified emp_val field should be in the format YYYYMMDD HHMMSS. The parameter ignores the specified date and only checks the time portion of the string so that 19000101 can be used in all cases, followed by a space, and the time you want the 24-hour time period to start. By defining the start time in an emp_val field, you can configure the rule so that the 24-hour time period starts at different times for different employees. If an emp_val setting is supplied, but no value is found, an error is thrown.
  • Specify 24_HOUR_RESET to configure the rule to determine the 24-hour start time dynamically using this algorithm. If the difference between the first eligible record on the current day and the first eligible record of the previous day is greater than 24 hours, the current day's first eligible record's start time becomes the 24-hour start time. Otherwise, the rule looks back until a day off, or a gap of greater than 24 hours, is found. The maximum number of days the rule looks back is defined by the Max Days Look Back parameter.
  • Specify PREVIOUS_DAY_START to define the 24-hour start time as the start time of the first eligible work detail of the previous day. If there are no eligible work details on the previous day, then the start time of the first eligible work detail of the current day is used.
Calculation Period This parameter defines the range of work details the rule calculates. You can configure the rule to calculate the time before, during, or after the 24-hour start time.

Generally, you configure three instances of the rule to cover the different conditions that can occur before, during, or after the 24-hour start time, such as the day being a holiday, weekend, or regular work day.

Select one of these options from the drop-down list:

  • BEFORE_START_TIME: Calculates only the work details that occur before the 24-hour start time.
  • AFTER_START_TIME: Calculates the work details that occur during the 24-hour period (after the 24-hour period start time and for the next 24 hours).
  • AFTER_24HOUR: Calculates the work details that occur after the end of the 24-hour period (24 hours after the 24-hour period start time).
  • ALL: Calculates all work details.
Max Days Look Back Specify the maximum number of days to look back to determine the 24-hour start time. This parameter is used only when the 24 Hour Start Time parameter is set to 24_HOUR_RESET.
Assign Better Rate Select this check box to prevent situations that can arise whereby switching an employee to an overtime hour type results in the employee being paid a lower rate.

Example: 24-hour start time defined using algorithm

The rule checks 7-consecutive days for a 24-hour rest period that starts on or before 8:00 and ends on or after 17:00, as long as the employee has worked at least 20 hours. The relevant parameter settings are:

  • Hour Set Description = REG=480, OT1=99999
  • 24 Hour Start Time = 24_HOUR_RESET

The employee's work details before the rule was applied:

Day Start Time End Time Hours Time Code Hour Type
0 OFF
1 10:00 18:00 8 WRK REG
2 8:00 18:00 10 WRK REG
3 6:00 12:00 6 WRK REG
4 11:00 19:00 8 WRK REG
5 10:00 18:00 8 WRK REG

Based on the algorithm, the rule groups eligible work details in 24-hour periods, resulting in these work details:

Day Start Time End Time Hours Time Code Hour Type
0 OFF
1 10:00 18:00 8 WRK REG
2 08:00 10:00 2 WRK OT1
2 10:00 18:00 8 WRK REG
3 06:00 10:00 4 WRK OT1
3 10:00 12:00 2 WRK REG
4 11:00 19:00 8 WRK REG
5 10:00 11:00 1 WRK OT1
5 11:00 18:00 7 WRK REG

10:00 is used as the start time for Day 1, 2, and 3. There is a 24-hour gap between Day 3's start time and Day 4's start time, so 11:00 is used as the start time for Day 4 and again for Day 5.