static function getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, $type_id, $name) { $psealf = new PayStubEntryAccountListFactory(); $psealf->getByCompanyIdAndTypeAndFuzzyName($company_id, $type_id, $name); if ($psealf->getRecordCount() > 0) { return $psealf->getCurrent()->getId(); } return FALSE; }
$ulf->getById($mapped_row['user_id']); } elseif (isset($mapped_row['user_name']) and $mapped_row['user_name'] != '') { $ulf->getByUserName($mapped_row['user_name']); } if ($ulf->getRecordCount() == 1) { $u_obj = $ulf->getCurrent(); $psaf->setUser($u_obj->getId()); if (isset($mapped_row['status_id']) and $mapped_row['status_id'] != '') { $psaf->setStatus(Misc::importCallInputParseFunction('status_id', $mapped_row['status_id'], $filtered_import_map['status_id']['default_value'], $filtered_import_map['status_id']['parse_hint'])); } if (isset($mapped_row['type_id']) and $mapped_row['type_id'] != '') { $psaf->setType(Misc::importCallInputParseFunction('type_id', $mapped_row['type_id'], $filtered_import_map['type_id']['default_value'], $filtered_import_map['type_id']['parse_hint'])); } if (isset($mapped_row['pay_stub_account']) and $mapped_row['pay_stub_account'] != '') { $psealf = new PayStubEntryAccountListFactory(); $psealf->getByCompanyIdAndTypeAndFuzzyName($ulf->getCurrent()->getCompany(), array(10, 20, 30, 50, 60, 65), $mapped_row['pay_stub_account']); if ($psealf->getRecordCount() > 0) { $psaf->setPayStubEntryNameId(Misc::importCallInputParseFunction('pay_stub_account', $psealf->getCurrent()->getId(), $filtered_import_map['pay_stub_account']['default_value'], $filtered_import_map['pay_stub_account']['parse_hint'])); } else { $psaf->setPayStubEntryNameId(Misc::importCallInputParseFunction('pay_stub_account', "Invalid Pay Stub Account ", $filtered_import_map['pay_stub_account']['default_value'], $filtered_import_map['pay_stub_account']['parse_hint'])); } } if (isset($mapped_row['units']) and $mapped_row['units'] != '') { $psaf->setUnits(Misc::importCallInputParseFunction('units', $mapped_row['units'], $filtered_import_map['units']['default_value'], $filtered_import_map['units']['parse_hint'])); } if (isset($mapped_row['rate']) and $mapped_row['rate'] != '') { $psaf->setRate(Misc::importCallInputParseFunction('rate', $mapped_row['rate'], $filtered_import_map['rate']['default_value'], $filtered_import_map['rate']['parse_hint'])); } if (isset($mapped_row['amount']) and $mapped_row['amount'] != '') { $psaf->setAmount(Misc::importCallInputParseFunction('amount', $mapped_row['amount'], $filtered_import_map['amount']['default_value'], $filtered_import_map['amount']['parse_hint'])); }