Exclude Employees With Less Than 90 Days from Holiday Hours - TWP

The following script can be used in TimeWorksPlus to limit Holiday hours to employees that have completed a probationary period, i.e. 90 days of service.

Before implementing this script, you'll need:
  • Designated holidays through the Holiday Configuration rule with one of the Pay Eligibility rules in place.

    The Holiday Configuration Rule should be set to pay Holiday hours for this script to work
  • Employees must have a Start Date in Employee Setup
The process used here is that employees will get Holiday hours based on the settings in the Holiday Configuration rule. Then the script checks to see if the employee has been with the company for less than 90 days. If that is true, the Holiday hours will be changed to 0.

The script has set the hours to 0 because this employee is still in the 90 day probationary period
This script will go in the PayRate Script box and is written to check for holiday hours on the time card. If it finds them, it checks to see if the employee has less than or equal to 90 days of service. If that is true, then the hours are set to 0.
if(reportingdate.isholiday and ishours and category = "Holiday" and employee.daysofservice <= 90){
     hours = 0;}

Can I Get Rid of the "Holiday" in the Category Column?

Your client might not like seeing a random "Holiday" entry on the time card with no hours tied to it. There is a way to also clear that out with one additional line added to our script:
if(reportingdate.isholiday and ishours and category = "Holiday" and employee.daysofservice <= 90){
     hours = 0;
     category = "Regular";}
By changing the category back to Regular, the time card will now display a null value in the category column.

Do I Have to Use the Holiday Configuration Rule?

When you view the processing rules page, you may see holiday rules other than the Holiday Configuration rule in place. There are some "legacy" holiday rules that many accounts still use.

If you search for "holiday" rules on the Processing page, you will find more than just the Holiday Configuration rule.
Technically, holiday hours can be added to a time card in one of two ways. You can use the older Holiday Rule in conjunction with the legacy holiday rules (the US, Canada, Mexico and user rules) to add hours, but those rules are rather limited. We suggest using the Holiday Configuration Rule in place of those rules, which not only designates the account holidays but will also can add the holiday hours. 

IMPORTANT: If you choose to change an account from the legacy holiday rules to the Holiday Configuration rule, you must disable the legacy rules first. As long as the pay periods are finalized, you will not lose any historical data.

Did you find this article helpful?