Home      Ask a Question      My Stuff      Help   
  
TimeWorks/TimeWorksPlus: Scripting - Paid Lunch Breaks
This works against a paid break of 30 minutes as long as they are not out longer than 2 hours (120 minutes).

Both the "paidbreak" (in the example "paidbreak = 30;") (paid break time) and 120 (2 hours as the cut off of how long an employee can be out and the script still work) can be changed to something else if need be. For example they want to only pay up to 20 minutes paid break just change it from "paidbreak = 30;" to "paidbreak = 20;" (no quotes).

==Note: This is only appropriate working off of a single break punch as if they clock OUT then IN again for break multiple times this will run on every break and may not be desired.==

paidbreak = 30;
breakmincap = 240;

if (minutesout (0) > 0 AND minutesout (0) <= paidbreak)
{
hours = hours + ((((minutesout (0) / 60) * 1000) \ 1) / 1000);
x = cstr (minutesout (0)) + " Min Paid Break";
}

if (minutesout (0) > paidbreak AND minutesout (0) < breakmincap)
{
hours = hours + ((((val (paidbreak) / 60) * 1000) \ 1) / 1000);
x = cstr (paidbreak) + " Min Paid Break";
}

==Also Note: If the feature "OutPunchCompletion" is being used you will have to surround the script using the "DURING (PostOPC)" scripting keyword.==

In TimeWorksPlus, this script would be the following and would need to be added to the "PayRateScript" scripting box:

if(minutesout(false) > 0 and isfirsttoday = FALSE){

paidbreak = 30;
breakmincap = 240;

a= (minutesout(false));
if(a<=paidbreak){
hours= (hours+(a/60));
addalert(cstr(minutesout) + " Min Paid Break");
}
if ((a > paidbreak) AND (a < breakmincap)){
hours = (hours + (val(paidbreak)/60));
addalert(cstr(paidbreak) + " Min Paid Break");
}
}

Scripting (Main Page) > Scripting - Breaks & Lunches (Main Page)
ID
583
Category
<Unassigned>
Date Created
6/29/2011 1:39:35 PM
Date Updated
3/9/2016 10:23:33 AM
Back to Search Results