$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();
 $title_options = $utlf->getByCompanyIdArray($current_company->getId());
 $crlf = new CurrencyListFactory();
 $crlf->getByCompanyId($current_company->getId());
 $currency_options = $crlf->getArrayByListFactory($crlf, FALSE, TRUE);
 //Get Base Currency
 $crlf->getByCompanyIdAndBase($current_company->getId(), TRUE);
 if ($crlf->getRecordCount() > 0) {
     $base_currency_obj = $crlf->getCurrent();
 }
 $currency_convert_to_base = FALSE;
 function getDepartments($station_id)
 {
     Debug::Text('Getting Departments 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) {
             $dlf = new DepartmentListFactory();
             $dlf->getByCompanyIdAndStatus($company_id, 10);
             if ($dlf->getRecordCount() > 0) {
                 $x = 0;
                 foreach ($dlf as $d_obj) {
                     $department_list["'{$x}'"] = array('id' => (int) $d_obj->getId(), 'manual_id' => (int) $d_obj->getManualID(), 'name' => $d_obj->getName());
                     $x++;
                 }
                 if (isset($department_list)) {
                     return $department_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();
     }
     $dlf = new DepartmentListFactory();
     $dlf->getHighestManualIDByCompanyId($company_id);
     if ($dlf->getRecordCount() > 0) {
         $next_available_manual_id = $dlf->getCurrent()->getManualId() + 1;
     } else {
         $next_available_manual_id = 1;
     }
     return $next_available_manual_id;
 }