Because of the sequence of the time card generator the keywords "islasttoday" and "isfirsttoday" are not available under the RoundScript Processing Rule.
A work around though is the use the keywords "minutesout" and "minutestil" that are available under RoundScript.
- To round the first IN punch we use the "minutesout" keyword. See the below example:
if (minutesout > 240) { roundin ("N15"); }
The above example reads that if the IN punch is at least 4 hours (240 minutes) or greater from the last OUT punch then round the IN punch to the nearest 15 minutes. The assumption is that the last OUT punch would be one from the previous day and would be at least 4 hours away from their first IN punch of the current day.
- To round the last OUT punch of the day we would use the "minutestil" keyword. See the below example:
if (minutestil > 240) { roundout ("N15"); }
The above example reads that if the OUT punch is at least 4 hours (240 minutes) or greater til the next IN punch then round the OUT punch to the nearest 15 minutes. The assumption is that the next IN punch would be for the next day and would be at least 4 hours away from their last OUT punch of the current day.
Note: As we are at the most making a logical guess things can happen that will cause this to not work as intended. For example the employee is asked to work a double shift which could break our 4 hour window.
| |