$psea_arr[$psea_obj->getId()] = array('name' => $psea_obj->getName(), 'debit_account' => $psea_obj->getDebitAccount(), 'credit_account' => $psea_obj->getCreditAccount());
     }
 }
 //var_dump($psea_arr);
 //Get all pay stubs.
 $pslf = new PayStubListFactory();
 //$pslf->getByUserIdAndCompanyIdAndPayPeriodId( $filter_data['user_ids'], $current_company->getId(), $filter_data['pay_period_ids'] );
 $pslf->getSearchByCompanyIdAndArrayCriteria($current_company->getId(), $filter_data);
 if ($pslf->getRecordCount() > 0) {
     $ulf = new UserListFactory();
     $blf = new BranchListFactory();
     $branch_options = $blf->getByCompanyIdArray($current_company->getId());
     //Get Branch ID to Branch Code mapping
     $branch_code_map = array(0 => 0);
     $blf->getByCompanyId($current_company->getId());
     if ($blf->getRecordCount() > 0) {
         foreach ($blf as $b_obj) {
             $branch_code_map[$b_obj->getId()] = $b_obj->getManualID();
         }
     }
     $dlf = new DepartmentListFactory();
     $department_options = $dlf->getByCompanyIdArray($current_company->getId());
     //Get Department ID to Branch Code mapping
     $department_code_map = array(0 => 0);
     $dlf->getByCompanyId($current_company->getId());
     if ($dlf->getRecordCount() > 0) {
         foreach ($dlf as $d_obj) {
             $department_code_map[$d_obj->getId()] = $d_obj->getManualID();
         }
     }
     $utlf = new UserTitleListFactory();
 function getBranches($station_id)
 {
     Debug::Text('Getting Branches for Station ID: ' . $station_id, __FILE__, __LINE__, __METHOD__, 10);
     if ($station_id == '') {
         return FALSE;
     }
     //Gets all users allowed to punch in/out from this station
     $slf = new StationListFactory();
     $slf->getByStationID($station_id);
     if ($slf->getRecordCount() > 0) {
         $s_obj = $slf->getCurrent();
         $company_id = $s_obj->getCompany();
         if ($company_id != FALSE) {
             $blf = new BranchListFactory();
             $blf->getByCompanyIdAndStatus($company_id, 10);
             if ($blf->getRecordCount() > 0) {
                 $x = 0;
                 foreach ($blf as $b_obj) {
                     $branch_list["'{$x}'"] = array('id' => (int) $b_obj->getId(), 'manual_id' => (int) $b_obj->getManualID(), 'name' => $b_obj->getName());
                     $x++;
                 }
                 if (isset($branch_list)) {
                     return $branch_list;
                 }
             }
         }
     }
     return FALSE;
 }
 static function getNextAvailableManualId($company_id = NULL)
 {
     global $current_company;
     if ($company_id == '' and is_object($current_company)) {
         $company_id = $current_company->getId();
     } elseif ($company_id == '' and isset($this) and is_object($this)) {
         $company_id = $this->getCompany();
     }
     $blf = new BranchListFactory();
     $blf->getHighestManualIDByCompanyId($company_id);
     if ($blf->getRecordCount() > 0) {
         $next_available_manual_id = $blf->getCurrent()->getManualId() + 1;
     } else {
         $next_available_manual_id = 1;
     }
     return $next_available_manual_id;
 }