Home      Ask a Question      My Stuff      Help   
  
Scripting - DURING (CalculateOTThreshold)
DURING CalculateOTThreshold

This processing phase occurs AFTER all of the Overtime Thresholds have been calculated, but before the hours have been split between regular and overtime. At this point in the processing, you can overwrite the following variables to make individual punches eligible or ineligible for overtime.

OT1Threshold
OT2Threshold
OT1DayThreshold
OT2DayThreshold

OT1 is for Time and a Half, and OT2 is for double time. You also get access to the value of variables that ordinarily have not been computed during the main processing script:

OTDayNumber tracks days of continuous work within a work week. So "OTDayNumber = 1" for the first day of work, "OTDayNumber = 2" for the second. It resets back to 1 whenever an entire day goes by without any OT eligible clocked hours, OR whenever a new work week is started.

DURING(CalculateOTThreshold)
{

if(Home3 = 'H2A')
{
if(OtDayNumber =6)
{
ot1daythreshold =0;
}
}

}

This script checks for the information in Home3. If it finds "H2A" in Home3 then we apply specific overtime rules. If we are on the 6th consecutive day, we specify another new OT condition. This script is run DURING the phase that the system is applying overtime.

==NOTE: The DURING statement cannot go inside any IF statement (otherwise it will have no effect). During this phase, you CANNOT round times, and you CANNOT split punches, as the post-processing for these functions has already taken place. Also, you SHOULD NOT change the pay rates here. If you do in some cases it will not calculate properly.

TIMEWORKSPLUS NOTE
The use of this function is only necessary in TimeWorks. You do not need to use "DURING CalculateOTThreshold" in TimeWorksPlus. In TimeWorksPlus, you can script changes to the overtime threshold by using a similar script in the OTThresholdScript box. For example:

if(employee.home3 = 'H2A')
{
if(OtDayNumber =6)
{
ot1daythreshold =0;
}
}
ID
472
Category
<Unassigned>
Date Created
3/1/2010 12:28:21 PM
Date Updated
8/12/2015 11:32:43 AM
Back to Search Results