Home      Ask a Question      My Stuff      Help   
  
TimeWorksPlus: Scripting Auto Lunch
Some of the pluses of using this is:

1. It will work with the rest of the scripting keywords and processes we have, so for example:

2. You can have it work only on certain days or have it change depending on the day as opposed to the Auto-Lunch feature which is a either on/off regardless of the day.

3. You can also have the script react in different ways depending on the amount of hours worked. For example if they got a 15 minute break after 2 hours of work but also got an additional 30 minutes break if they worked at or over 4 hours. We can make the script at the 2 hours mark do a 15 minute deduction then at the 4 hour mark we can have another script overwrite the earlier script and give them a 45 minute (a 15 minute at the 2 hours mark + a 30 minute break at the 4 hour mark) deduction instead.

4. It is retro, meaning it will affect all punches with the exclusion of punches that have been Finalized.

Keep in mind that this script must be placed in the PayRateScript Processing Rule. Below is an example of a basic script for doing this. In the example, if the system sees that a punch spans to or over 6 hours, deduct 30 minutes or .5 (decimal)hours off of the total hours worked for that punch:

For one punch IN/OUT a day:

if(hours > 6 and breakseconds <= 0){
breakseconds = 1800;
hours = hours - (breakseconds / 3600);
}

A screen shot of this is below working on a 8 hour punch:




For multiple punches IN/OUT a day:

if(reportingdate.totalhours > 6 and islasttoday and breakseconds <= 0){
breakseconds = 1800;
hours = hours - (breakseconds / 3600);
}

A screen shot of this is below working on a 8 hour punch:






For Multiple punches that takes into consideration all of their time that they clocked out and if less than an amount will deduct the rest it would be:

$ttt = 60;


$to = (((val(reportingdate.spread)/3600)-reportingdate.totalhours));
if( $to < ($ttt/60) and islasttoday){
hours = hours - (($ttt/60)-$to);
}


This scripting would be placed in the PayRateScript processing rule.
ID
814
Category
<Unassigned>
Date Created
1/24/2013 12:32:22 PM
Date Updated
3/16/2015 4:15:51 PM
Back to Search Results