Home      Ask a Question      My Stuff      Help   
  
TimeWorks Plus: Using Scripting AND the "AutoHoursWeek" Processing Rule to Add Different Amounts to Different Employees
The "AutoHoursWeek" Processing Rule allows on to add hours automatically to all employees or based on something in Employee Setup such the Department or Location field automatically be the day of the week.

One of the limitations of the rule though is that one cannot create multiple rules to assign different hour values to different employees. But through scripting we can adjust the hours as long as "AutoHoursWeek" creates the punch.

The following scripts would go in the PayRate Script box.

For example if we set "AutoHoursWeek" to generate an 8 hour punch every Monday through Friday BUT you want certain employees to only get 6 hours because they are part time workers. We can allow the rule to run BUT once it gets to the time card we can adjust the 8 hours to 6 using the below script:

if (hours = "8" AND category = "Regular" AND employee.home3 = "PT")
{
hours = 6;
}

With this we enter in "PT" in Home 3 in Employee Setup for the part time workers and if the script sees this it will adjust any 8 hour value under the category of "Regular" like the one generated by the "AutoHoursWeek" to 6 hours instead. The script must be entered in the PayRateScript box.

Also if you want to change the days for example if we added to our example and the Part Time employees only get hours on Monday through Thursday we can add a Days script (TimeWorks Plus: Scripting Based on the Day of the Week) and zero out the days they are not supposed to be paid for like in the below article:

if (hours = 8 AND category = "Regular" AND employee.home3 = "PT")
{
hours = 6;
if ("F" contains weekday (reportingdate.date))
{
Hours = 0;
}}

In the above we first adjust their hours from 8 hours to 6 AND in addition using the days script zero out hours generated for Friday (F). With that they would be paid for all days under the AutoHoursWeek Rule excluding Friday.

ID
1079
Category
<Unassigned>
Date Created
1/20/2014 1:26:37 PM
Date Updated
5/15/2015 11:25:02 AM
Back to Search Results