$psenaf->CommitTransaction(); Redirect::Page(URLBuilder::getURL(NULL, Environment::getBaseURL() . '/pay_stub/EditPayStubEntryNameAccount.php')); break; default: if (!isset($action)) { BreadCrumb::setCrumb($title); $psenalf = new PayStubEntryNameAccountListFactory(); $psenalf->getByCompanyId($current_company->getId()); foreach ($psenalf as $name_account_obj) { //Debug::Arr($department,'Department', __FILE__, __LINE__, __METHOD__,10); $name_account_data[$name_account_obj->getPayStubEntryNameId()] = array('id' => $name_account_obj->getId(), 'pay_stub_entry_name_id' => $name_account_obj->getPayStubEntryNameId(), 'debit_account' => $name_account_obj->getDebitAccount(), 'credit_account' => $name_account_obj->getCreditAccount(), 'created_date' => $name_account_obj->getCreatedDate(), 'created_by' => $name_account_obj->getCreatedBy(), 'updated_date' => $name_account_obj->getUpdatedDate(), 'updated_by' => $name_account_obj->getUpdatedBy(), 'deleted_date' => $name_account_obj->getDeletedDate(), 'deleted_by' => $name_account_obj->getDeletedBy()); } //Get all accounts $psenlf = new PayStubEntryNameListFactory(); $psenlf->getAll(); $type_options = $psenlf->getOptions('type'); $i = 0; foreach ($psenlf as $entry_name_obj) { $display_type = FALSE; if ($i == 0) { $display_type = TRUE; } else { if ($entry_name_obj->getType() != $prev_type_id) { $display_type = TRUE; } } $name_account_data[$entry_name_obj->getId()]['pay_stub_entry_description'] = $entry_name_obj->getDescription(); $name_account_data[$entry_name_obj->getId()]['pay_stub_entry_name_id'] = $entry_name_obj->getId(); $name_account_data[$entry_name_obj->getId()]['type_id'] = $entry_name_obj->getType(); $name_account_data[$entry_name_obj->getId()]['type'] = $type_options[$entry_name_obj->getType()]; $name_account_data[$entry_name_obj->getId()]['display_type'] = $display_type;