$is_previous_time_sheet_verified = TRUE; //There is no previous pay period } unset($previous_pay_period_obj, $pptsvlf, $pptsv_obj, $pplf); } //Get pay period totals //Sum all Worked Hours //Sum all Paid Absences //Sum all Dock Absences //Sum all Regular/OverTime hours $udtlf = new UserDateTotalListFactory(); $worked_total_time = (int) $udtlf->getWorkedTimeSumByUserIDAndPayPeriodId($user_id, $pay_period_id); Debug::text('Worked Total Time: ' . $worked_total_time, __FILE__, __LINE__, __METHOD__, 10); $paid_absence_total_time = $udtlf->getPaidAbsenceTimeSumByUserIDAndPayPeriodId($user_id, $pay_period_id); Debug::text('Paid Absence Total Time: ' . $paid_absence_total_time, __FILE__, __LINE__, __METHOD__, 10); $dock_absence_total_time = $udtlf->getDockAbsenceTimeSumByUserIDAndPayPeriodId($user_id, $pay_period_id); Debug::text('Dock Absence Total Time: ' . $dock_absence_total_time, __FILE__, __LINE__, __METHOD__, 10); $udtlf->getRegularAndOverTimeSumByUserIDAndPayPeriodId($user_id, $pay_period_id); if ($udtlf->getRecordCount() > 0) { //Get overtime policy names $otplf = new OverTimePolicyListFactory(); $over_time_policy_options = $otplf->getByCompanyIdArray($current_company->getId(), FALSE); foreach ($udtlf as $udt_obj) { Debug::text('Type ID: ' . $udt_obj->getColumn('type_id') . ' OverTime Policy ID: ' . $udt_obj->getColumn('over_time_policy_id') . ' Total Time: ' . $udt_obj->getColumn('total_time'), __FILE__, __LINE__, __METHOD__, 10); if ($udt_obj->getColumn('type_id') == 20) { $name = TTi18n::gettext('Regular Time'); } else { if (isset($over_time_policy_options[$udt_obj->getColumn('over_time_policy_id')])) { $name = $over_time_policy_options[$udt_obj->getColumn('over_time_policy_id')]; } else { $name = TTi18n::gettext('N/A');