function getPayrollDeductionObject() { if (!isset($this->payroll_deduction_obj)) { require_once Environment::getBasePath() . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'payroll_deduction' . DIRECTORY_SEPARATOR . 'PayrollDeduction.class.php'; $this->payroll_deduction_obj = new PayrollDeduction('CA', NULL); $this->payroll_deduction_obj->setDate(TTDate::getTimeStamp($this->year, 12, 31)); } return $this->payroll_deduction_obj; }
} } unset($tmp_schedule_shifts, $tmp2_schedule_shifts); $tmp_schedule_shifts = $schedule_shifts; } //print_r($schedule_shifts); if (isset($tmp_schedule_shifts)) { //Format array so Smarty has an easier time. foreach ($tmp_schedule_shifts as $day_epoch => $day_tmp_schedule_shift) { foreach ($day_tmp_schedule_shift as $branch => $department_schedule_shifts) { foreach ($department_schedule_shifts as $department => $user_schedule_shifts) { foreach ($user_schedule_shifts as $user_id => $user_schedule_shifts) { $x = 0; foreach ($user_schedule_shifts as $user_schedule_shift) { if ($x == 0) { $tmp_min_start_date = TTDate::getTimeStamp(date('Y', $user_schedule_shift['start_time']), date('m', $user_schedule_shift['start_time']), date('d', $user_schedule_shift['start_time']), $min_hour); } else { $tmp_min_start_date = $prev_user_schedule_shift['end_time']; } $off_duty = ($user_schedule_shift['start_time'] - $tmp_min_start_date) / 900; //15 Min increments $on_duty = ($user_schedule_shift['end_time'] - $user_schedule_shift['start_time']) / 900; $user_schedule_shift['off_duty'] = $off_duty; $user_schedule_shift['on_duty'] = $on_duty; $schedule_shifts[$day_epoch][$branch][$department][$user_id][] = $user_schedule_shift; $prev_user_schedule_shift = $user_schedule_shift; $x++; } } } }