Home      Ask a Question      My Stuff      Help   
  
TimeWorks Plus - Splitting After a Week Hours Threshold
The below script can be added to the "SplitPostReportingDateScript" Processing Rule and splits a times punch at 40 hours and assigns any "Regular" time punches to "Overtime".

$hoursval = 40;
$cat1 = "Regular";
$cat2 = "Overtime";

if (category = $cat1) {
ogcat = category;
$diff = reportingdate.weekhours ("Regular") - $hoursval;
category = $cat2;
split(dateadd("h", $diff, intime), false, false);
category = ogcat;
}

- The amount of hours being tracked can be adjusted by adjusting the "$hoursval" value.
- The category being tracked can adjusted by adjusting the category for "$cat1".
- The category being split off to can adjusted by adjusting the category for "$cat2".

Note, though hours only punches can figure into the hours threshold this script cannot split a hours only punch just punches that consist of an IN and OUT times.

Also note the categories used will need to be added in PunchCategories with the exception of "Regular" which is enabled by default.


ID
1625
Category
>Support
  Scripting
Date Created
8/25/2015 10:39:44 AM
Date Updated
9/4/2015 6:04:33 PM
Back to Search Results