} $ulf = new UserListFactory(); $utlf = new UserTitleListFactory(); $title_options = $utlf->getByCompanyIdArray($current_company->getId()); $blf = new BranchListFactory(); $branch_options = $blf->getByCompanyIdArray($current_company->getId()); $dlf = new DepartmentListFactory(); $department_options = $dlf->getByCompanyIdArray($current_company->getId()); $uglf = new UserGroupListFactory(); $group_options = $uglf->getArrayByNodes(FastTree::FormatArray($uglf->getByCompanyIdArray($current_company->getId()), 'no_tree_text', TRUE)); //Get verified timesheets //Ignore if more then one pay period is selected $verified_time_sheets = NULL; if (isset($filter_data['pay_period_ids']) and count($filter_data['pay_period_ids']) > 0) { $pptsvlf = new PayPeriodTimeSheetVerifyListFactory(); $pptsvlf->getByPayPeriodIdAndCompanyId($filter_data['pay_period_ids'][0], $current_company->getId()); if ($pptsvlf->getRecordCount() > 0) { foreach ($pptsvlf as $pptsv_obj) { $verified_time_sheets[$pptsv_obj->getUser()][$pptsv_obj->getPayPeriod()] = array('status_id' => $pptsv_obj->getStatus(), 'created_date' => $pptsv_obj->getCreatedDate()); } } } if (isset($tmp_rows)) { $i = 0; foreach ($tmp_rows as $pay_period_id => $data_a) { foreach ($data_a as $user_id => $data_b) { $user_obj = $ulf->getById($user_id)->getCurrent(); if (isset($pay_period_options[$pay_period_id])) { $rows[$i]['pay_period'] = $pay_period_options[$pay_period_id]; } else { $rows[$i]['pay_period'] = 'N/A';
//print_r($tmp_rows); $ulf = new UserListFactory(); $utlf = new UserTitleListFactory(); $title_options = $utlf->getByCompanyIdArray($current_company->getId()); $uglf = new UserGroupListFactory(); $group_options = $uglf->getArrayByNodes(FastTree::FormatArray($uglf->getByCompanyIdArray($current_company->getId()), 'no_tree_text', TRUE)); $blf = new BranchListFactory(); $branch_options = $blf->getByCompanyIdArray($current_company->getId()); $dlf = new DepartmentListFactory(); $department_options = $dlf->getByCompanyIdArray($current_company->getId()); //Get verified timesheets //Ignore if more then one pay period is selected $verified_time_sheets = NULL; if (isset($pay_period_ids) and count($pay_period_ids) > 0) { $pptsvlf = new PayPeriodTimeSheetVerifyListFactory(); $pptsvlf->getByPayPeriodIdAndCompanyId(array_keys($pay_period_ids), $current_company->getId()); if ($pptsvlf->getRecordCount() > 0) { foreach ($pptsvlf as $pptsv_obj) { $verified_time_sheets[$pptsv_obj->getUser()][$pptsv_obj->getPayPeriod()] = $pptsv_obj->getStatus(); } } } if (isset($tmp_rows)) { $x = 0; foreach ($tmp_rows as $user_id => $data_a) { $user_obj = $ulf->getById($user_id)->getCurrent(); foreach ($data_a as $pay_period_id => $data_b) { $rows[$x]['user_id'] = $user_obj->getId(); $rows[$x]['full_name'] = $user_obj->getFullName(TRUE); $rows[$x]['employee_number'] = $user_obj->getEmployeeNumber(); $rows[$x]['status'] = Option::getByKey($user_obj->getStatus(), $user_obj->getOptions('status'));
$pending_requests = 0; $rlf = new RequestListFactory(); $rlf->getSumByPayPeriodIdAndStatus($pay_period_obj->getId(), 30); if ($rlf->getRecordCount() > 0) { $pending_requests = $rlf->getCurrent()->getColumn('total'); } //Get PS Amendments. $psalf = new PayStubAmendmentListFactory(); $psalf->getByUserIdAndAuthorizedAndStartDateAndEndDate($pay_period_schedule->getUser(), TRUE, $pay_period_obj->getStartDate(), $pay_period_obj->getEndDate()); $total_ps_amendments = 0; if (is_object($psalf)) { $total_ps_amendments = $psalf->getRecordCount(); } //Get verified timesheets $pptsvlf = new PayPeriodTimeSheetVerifyListFactory(); $pptsvlf->getByPayPeriodIdAndCompanyId($pay_period_obj->getId(), $current_company->getId()); $verified_time_sheets = 0; $pending_time_sheets = 0; if ($pptsvlf->getRecordCount() > 0) { foreach ($pptsvlf as $pptsv_obj) { if ($pptsv_obj->getAuthorized() == TRUE) { $verified_time_sheets++; } elseif ($pptsv_obj->getStatus() == 30) { $pending_time_sheets++; } } } //Get total employees with time for this pay period. $udtlf = new UserDateTotalListFactory(); $total_worked_users = $udtlf->getWorkedUsersByPayPeriodId($pay_period_obj->getId()); //Count how many pay stubs for each pay period.