$next_employee_number = $ulf->getCurrent()->getEmployeeNumber() + 1; $uf->setEmployeeNumber($next_employee_number); } unset($ulf, $next_employee_number); } if (isset($mapped_row['pay_period_schedule_id']) and $mapped_row['pay_period_schedule_id'] != '') { $uf->setPayPeriodSchedule(Misc::importCallInputParseFunction('pay_period_schedule_id', $mapped_row['pay_period_schedule_id'], $filtered_import_map['pay_period_schedule_id']['default_value'], $filtered_import_map['pay_period_schedule_id']['parse_hint'])); } if (isset($mapped_row['policy_group_id']) and $mapped_row['policy_group_id'] != '') { $uf->setPolicyGroup(Misc::importCallInputParseFunction('policy_group_id', $mapped_row['policy_group_id'], $filtered_import_map['policy_group_id']['default_value'], $filtered_import_map['policy_group_id']['parse_hint'])); } if (isset($mapped_row['default_branch_id']) and $mapped_row['default_branch_id'] != '') { $tmp_branch = Misc::importCallInputParseFunction('default_branch_id', $mapped_row['default_branch_id'], $filtered_import_map['default_branch_id']['default_value'], $filtered_import_map['default_branch_id']['parse_hint']); if ($create_branch === TRUE) { //Check to see if branch exists or not. if (array_search(parse_default_branch_id($mapped_row['default_branch_id']), $branch_options) === FALSE) { //Create branch $bf = new BranchFactory(); $bf->setCompany($mapped_row['company_id']); $bf->setStatus(10); if (strtolower($filtered_import_map['default_branch_id']['parse_hint']) == 'parse_manual_id') { //Parse out any digits from the branch name and use them as the manual_id. $bf->setName($bf->Validator->stripNumeric($mapped_row['default_branch_id'])); $bf->setManualId($bf->Validator->stripNonNumeric($mapped_row['default_branch_id'])); $tmp_branch = $bf->getName(); } elseif (strtolower($filtered_import_map['default_branch_id']['parse_hint']) == 'manual_id') { $bf->setName($mapped_row['default_branch_id']); $bf->setManualId($mapped_row['default_branch_id']); } else { $next_available_manual_id = BranchListFactory::getNextAvailableManualId($mapped_row['company_id']); $bf->setName($mapped_row['default_branch_id']);
$next_employee_number = $ulf->getCurrent()->getEmployeeNumber() + 1; $uf->setEmployeeNumber($next_employee_number); } unset($ulf, $next_employee_number); } if (isset($mapped_row['pay_period_schedule_id']) and $mapped_row['pay_period_schedule_id'] != '') { $uf->setPayPeriodSchedule(Misc::importCallInputParseFunction('pay_period_schedule_id', $mapped_row['pay_period_schedule_id'], $filtered_import_map['pay_period_schedule_id']['default_value'], $filtered_import_map['pay_period_schedule_id']['parse_hint'])); } if (isset($mapped_row['policy_group_id']) and $mapped_row['policy_group_id'] != '') { $uf->setPolicyGroup(Misc::importCallInputParseFunction('policy_group_id', $mapped_row['policy_group_id'], $filtered_import_map['policy_group_id']['default_value'], $filtered_import_map['policy_group_id']['parse_hint'])); } if (isset($mapped_row['default_branch_id']) and $mapped_row['default_branch_id'] != '') { if ($create_branch === TRUE and !is_numeric($mapped_row['default_branch_id'])) { //Check to see if branch exists or not. //if ( array_search( $mapped_row['default_branch_id'], $branch_options ) === FALSE ) { if (parse_default_branch_id($mapped_row['default_branch_id']) === FALSE) { //Create branch $bf = new BranchFactory(); $bf->setCompany($mapped_row['company_id']); $bf->setStatus(10); $next_available_manual_id = BranchListFactory::getNextAvailableManualId($mapped_row['company_id']); $bf->setManualId($next_available_manual_id); $bf->setName($mapped_row['default_branch_id']); $bf->setCity('NA'); if ($bf->isValid()) { echo "[CB: " . $mapped_row['default_branch_id'] . "]"; $new_branch_id = $bf->Save(); $branch_options[$new_branch_id] = $mapped_row['default_branch_id']; } unset($bf, $new_branch_id, $next_available_manual_id); }