Home      Ask a Question      My Stuff      Help   
  
SUPPORT: SCRIPTING: Majority of shift
CRC

To change the shift times, just change the variables of $shift1Start, $shift2Start, $shift3Start to the corresponding times.
This script also requires 3 hidden numeric prompts for tracking total shift time.

// SplitScript
if(istimes){
$shift1Start = 07:00:00;
$shift2Start = 15:00:00;
$shift3Start = 23:00:00;

shift1 = val(shift1) + round(val(overlap($shift1Start, $shift2Start)) / 3600, 2);
shift2 = val(shift2) + round(val(overlap($shift2Start, $shift3Start)) / 3600, 2);
shift3 = val(shift3) + round(val(overlap($shift3Start, $shift1Start)) / 3600, 2);
}

// PayRateScript
if(istimes and otcategory <> ""){
$totalShift1Hrs = reportingdate.totalday("shift1");
$totalShift2Hrs = reportingdate.totalday("shift2");
$totalShift3Hrs = reportingdate.totalday("shift3");
if($totalShift1Hrs >= $totalShift2Hrs && $totalShift1Hrs >= $totalShift3Hrs){
category = "1st Shift";
} else if($totalShift2Hrs >= $totalShift1Hrs && $totalShift2Hrs >= $totalShift3Hrs){
category = "2nd Shift";
} else{
category = "3rd Shift";
}
}
ID
1887
Category
>Support
  Scripting
Date Created
7/31/2017 9:07:21 AM
Date Updated
7/14/2018 8:05:51 PM
Back to Search Results