Home      Ask a Question      My Stuff      Help   
  
Scripting - Overriding 'roundtoschedule' Rounding Rules for Approved Overtime Purposes
Question
ID
397
Category
Training
  FAQ's
Date Created
5/11/2009 10:09:34 AM
Date Updated
5/11/2009 12:27:34 PM
My client wants to be able to override the 'roundtoschedule' rounding script for either the first in, or last out, or both for approved overtime purposes. How would we go about doing this?
Answer
To do this would require a few scripts to work off of clock prompts which we will use as the approval to override the 'roundtoschedule' script (Scripting - Rounding Times to a Set Schedule ("Roundtoschedule")).

First we will need to create 4 scripts. One being the actual 'roundtoschedule' script then another 3 to exempt approved overtime punches based on either the first in punch, the last out punch or both:

1. First the 'roundtoschedule' script which in this example we will set to round back to their scheduled time the first in punch if they are early by 15 minutes and the last punch of the day if they leave late by 15 minutes to have it round back to their scheduled time. All other variables we will leave at '0' or in other words not to round. This will be triggered if there isn't anything entered (left blank) in the 'x' prompt field on the edit page:

if (x = "")
{
roundtoschedule (15,0,15,0);
}

2. Next for the first in punch it would read that if at the clock prompt 'x' (which we will use as our example but it can be either x, y, or z) has a 'F' or 'f' in it for first (this is also only an example and you can name the variable anything really) then round to schedule the first in punch to '0' which if set to that would mean not to round:

if (x = "F" or x = "f")
{
roundtoschedule (0,0,15,0);
x = "";
}

3. Next for the Last out punch it would read that if at the clock prompt 'x' (which we will use as our example but it can be either x, y, or z) has a 'L' or 'l' in it for last (this is also only an example and you can name the variable anything really) then round to schedule the last out punch to '0' which if set to that would mean not to round:

if (x = "L" or x = "l")
{
roundtoschedule (15,0,0,0);
x = "";
}

3. Last for the both the first in punch and last out punch it would read that if at the clock prompt 'x' (which we will use as our example but it can be either x, y, or z) has a 'B' or 'b' in it for both (this is also only an example and you can name the variable anything really) then round to schedule all punches to '0' which if set to that would mean not to round:

if (x = "B" or x = "b")
{
roundtoschedule (0,0,0,0);
x = "";
}

//Note: the x = ""; portion of the script is there so that the actual 'F','L', or 'B' will not show under a column on the time card just on edit time card page.

As for our prompt 'x' we will create prompt making sure we have these fields as such:

- Data Collection Mode: 'Show online, but do not collect anything' (This is set so the prompt will not show up on the clock itself just the edit screen).

- What do you want to name this field? You want to enter something that will let them know what to enter also there is 16 characters maximum so the shorter the better like 'OT (F/L/B)' without the quotes which we will use.

- How do you want the prompt to appear on the clock's screen? This can be anything as it will not show anywhere except on this page as we aren't using the prompts on the clock just on the edit page. There is 16 characters maximum so the shorter the better and of course only capital letters can be displayed. We will use 'OT' as our example.

- Collect data for employees with which type of cards? 'All colors'

- Should the data be visible or editable on the online edit screen? 'Visible and editable'

- What if the employee doesn't enter anything? 'Allow it. Leave the entry blank.

- What can an employee enter into this field? 'Anything, including numbers, symbols, and letters'

- How many digits can the employee enter? Minimum: 1 Maximum (up to 12): 12

- Require employees to choose an entry from a list? Leave this blank.

- Should the online Edit screen be exempted from these validation settings? 'No override - Use same restrictions as on clock.

After this just save the page then wait 10 minutes before transmitting the clocks to receive the new updated prompt.



Back to Search Results