Home      Ask a Question      My Stuff      Help   
  
Scripting - Forcing a Minimum amount of time for a Lunch Break
The below script will allow one to set a minimum amount of OUT time for lunch. This script only runs if they clock OUT for less than the forced time (Nlunch). Meaning if they clock OUT for longer this script will be ignored.

This applies to all OUT time in a shift. Meaning if they clock OUT more than once per shift (Lunches, Breaks) this will run multiple times. So this will only work if they only clock OUT then back IN from Lunch.

A TimeWorks version of the Script using a 30 minute minimum which can be adjusted to what is required by editing "Nlunch = ":

Nlunch = 30; //set this variable to the minimum minutes an employee must take for their break.
Mout = minutesout(0);
if (Mout > 0 and Mout < Nlunch)
{
hours = hours - ((Nlunch/60)-(Mout/60));
exception = ("Additional " + (Nlunch-Mout) + " mins deducted for lunch");
}

A TimeWorks Plus version of the script using a 60 minute minimum which can be adjusted to what is required by editing "Nlunch = " and MUST be added to the PayRateScript box in order to work properly:

Nlunch = 60; //set this variable to the minimum minutes an employee must take for their break.
Mout = minutesout;
if (Mout > 0 and Mout < Nlunch)
{
hours = hours - ((Nlunch/60)-(Mout/60));
addalert ("Additional " + (Nlunch-Mout) + " mins deducted for lunch");
}


Scripting (Main Page) > Scripting - Breaks & Lunches (Main Page)
ID
621
Category
<Unassigned>
Date Created
8/23/2011 8:54:07 AM
Date Updated
9/29/2015 6:44:51 PM
Back to Search Results