Examples
This section includes examples that describe the OFF clock process.
Example 1: Clock is within MAX_ON_TIME
- The MRP clock is February 10 at 5:00AM (05:00).
 - The MAX_ON_TIME value is 16.
 
These steps describe the process:
- The processing of an OFF clock punch for February 10 at 3:00PM (15:00) is started.
 - The first calculation is performed: 05:00 + 16:00 = 21:00.
 - Because the OFF punch is before 21:00, the clock is placed on the work summary for February 10.
 
Example 2: Clock is not within MAX_ON_TIME and is close to a scheduled off time
This example includes this scenario:
- The MRP clock is February 10 at 5:00AM (05:00).
 - On February 9, the employee's schedule ends at 5:00PM (17:00).
 - On February 10, the employee's schedule ends at 6:00PM (18:00).
 - On February 11, the employee's schedule ends at 7:00PM (19:00).
 - The MAX_ON_TIME value is 16.
 - The OFF_CLK_ADJ_MIN value is 15.
 
These steps describe the process:
- The processing of an OFF clock punch for February 10 at 10:00PM (22:00) is started.
 - The first calculation is performed: 05:00 + 16:00 = 21:00. 
            
Because the OFF clock of 22:00 is not before 21:00, the next phase of calculations is started.
 - February 10 is checked. This calculation is performed: (22:00 + 00:15) - 18:00 = 255 minutes.
 - February 9 is checked. This calculation is performed: (22:00 + 00:15) - 17:00 + 24 hours (for day difference) = 1755 minutes.
 - February 11 is checked. This calculation is performed: (22:00 + 00:15) - 19:00 + 24 hours (for day difference) = 1635 minutes.
 - Because February 10 has the smallest positive difference, the clock is placed on the February 10 work summary.
 
Example 3: Clock is not within MAX_ON_TIME and one day is scheduled OFF
This scenario is used for this exercise:
- The MRP clock is February 10 at 5:00AM (05:00).
 - On February 9, the employee's schedule ends at 5:00PM (17:00).
 - On February 10, the employee's schedule ends at 5:00PM (17:00).
 - On February 11, the employee is scheduled OFF.
 - The OFF_CLK_ADJ_MIN value is 0.
 - The MAX_ON_TIME value is 10.
 - The SCHEDULE_MAX_LOOK_BACK_DAYS value is 2.
 
These steps describe the process:
- The processing of an OFF clock for 6:00PM (18:00) on February 10 is started.
 - The first calculation is performed: 5:00 + 10:00 = 15:00. 
            
Because the OFF clock of 18:00 is not before 15:00, the next calculations are performed.
 - February 10 is checked. This calculation is performed: 18:00 - 17:00 = 60 minutes.
 - February 9 is checked. This calculation is performed: 18:00 - 17:00 + 24 hours (for the difference in day) = 1500 minutes.
 - February 11 is checked. Because no schedule for that day is found, the algorithm looks back a maximum of two days to find a schedule. 
            
- A schedule on February 10 is found and that end time, 17:00, is used for February 11.
 - The calculation for February 11 is 18:00 - 17:00 + 24 hours (for the difference in day) = 1500 minutes.
 
 - Because February 10 has the lowest positive difference, the clock is placed on the work summary for that day.
 
Example 4: No schedule data can be found for all three days
This example includes this scenario:
- MAX_ON_TIME = -1; therefore, the MRP clock is not used.
 - On February 7, the employee is scheduled OFF.
 - On February 8, the employee is scheduled OFF.
 - On February 9, the employee is scheduled OFF.
 - On February 10, the employee is scheduled OFF.
 - On February 11, the employee is scheduled OFF.
 - The OFF_CLK_ADJ_MIN value is 0.
 - The SCHEDULE_MAX_LOOK_BACK_DAYS value is 2.
 
These steps describe the process:
- The processing of an OFF clock for 18:00 on February 10 is started.
 - February 10 is checked. 
            
- Because no schedule is found for that day, the algorithm looks back a maximum of two days to find a schedule
 - Because all of those days are OFF, no schedule can be found to use as a template. The score of -1 is assigned to February 10.
 
 - February 9 is checked. Again, no schedule is found for that day and the score of -1 is assigned.
 - February 11 is checked and again a score of -1 is assigned.
 - Usually, the OFF clock is assigned to the lowest positive score. In this case, since all scores are -1, the OFF clock is assigned in this order: day of the clock, day before, and day after.
 - The OFF clock is placed on February 10.