// Make sure you add a hidden web only numeric prompt with the field name of otherHoursSoFar
// Change the next three variables to what you need, pipe delimited for the category lists $otherCategories = "Vacation|Holiday|Bereavement|Double Time|Holiday Double Time|Jury Duty|PTO"; $promoteCategories = "Regular"; $weeklyOTThreshold = 40; if(within(category, $otherCategories)){ otherHoursSoFar = hours; } ot1threshold = $weeklyOTThreshold;
$otweekhours = reportingdate.weekhours($otherCategories + "|" + $promoteCategories); $otherWeekHours = reportingdate.weekhours($otherCategories); $otherHoursSoFarThisWeek = reportingdate.totalweek("otherHoursSoFar"); $otherHoursLeftThisWeek = $otherWeekHours - $otherHoursSoFarThisWeek;
if($otweekhours > $weeklyOTThreshold and within(category, $promoteCategories)){ ot1threshold = $weeklyOTThreshold - $otherHoursLeftThisWeek; }
if(within(category, $otherCategories)){ ot1threshold = 400; }
CC 9/20/2017 | |