$utf->Save(); Redirect::Page(URLBuilder::getURL(array('user_id' => $tax_data['user_id'], 'data_saved' => TRUE), 'EditUserTax.php')); //Redirect::Page( URLBuilder::getURL( NULL , 'UserList.php') ); break; } default: if (isset($user_id) and $action != 'submit') { unset($tax_data); BreadCrumb::setCrumb($title); Debug::Text('User ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10); $ulf = new UserListFactory(); $ulf->getByIdAndCompanyId($user_id, $current_company->getId()); if ($ulf->getRecordCount() > 0) { $user_obj = $ulf->getCurrent(); } $utlf = new UserTaxListFactory(); //$uwlf->GetByUserIdAndCompanyId($current_user->getId(), $current_company->getId() ); $utlf->GetByUserId($user_id); foreach ($utlf as $tax) { //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10); //$user_id = $tax->getUser(); $tax_data = array('id' => $tax->getId(), 'user_id' => $tax->getUser(), 'country' => $user_obj->getCountry(), 'federal_claim' => $tax->getFederalClaim(), 'provincial_claim' => $tax->getProvincialClaim(), 'federal_additional_deduction' => $tax->getFederalAdditionalDeduction(), 'wcb_rate' => $tax->getWCBRate(), 'vacation_rate' => $tax->getVacationRate(), 'release_vacation' => $tax->getReleaseVacation(), 'ei_exempt' => $tax->getEIExempt(), 'cpp_exempt' => $tax->getCPPExempt(), 'federal_tax_exempt' => $tax->getFederalTaxExempt(), 'provincial_tax_exempt' => $tax->getProvincialTaxExempt(), 'federal_filing_status_id' => $tax->getFederalFilingStatus(), 'state_filing_status_id' => $tax->getStateFilingStatus(), 'federal_allowance' => $tax->getFederalAllowance(), 'state_allowance' => $tax->getStateAllowance(), 'state_additional_deduction' => $tax->getStateAdditionalDeduction(), 'state_ui_rate' => $tax->getStateUIRate(), 'state_ui_wage_base' => $tax->getStateUIWageBase(), 'social_security_exempt' => $tax->getSocialSecurityExempt(), 'ui_exempt' => $tax->getUIExempt(), 'medicare_exempt' => $tax->getMedicareExempt(), 'created_date' => $tax->getCreatedDate(), 'created_by' => $tax->getCreatedBy(), 'updated_date' => $tax->getUpdatedDate(), 'updated_by' => $tax->getUpdatedBy(), 'deleted_date' => $tax->getDeletedDate(), 'deleted_by' => $tax->getDeletedBy()); } if (!isset($tax_data)) { $tax_data = array('country' => $user_obj->getCountry(), 'wcb_rate' => 0, 'vacation_rate' => 0, 'federal_claim' => 0, 'provincial_claim' => 0, 'federal_additional_deduction' => 0, 'federal_allowance' => 0, 'state_allowance' => 0, 'state_additional_deduction' => 0, 'state_ui_rate' => 0, 'state_ui_wage_base' => 0); } } else { if ($tax_data['user_id'] != '') { $user_id = $tax_data['user_id']; } }
function getUserTaxObject() { if (is_object($this->user_tax_obj)) { return $this->user_tax_obj; } else { $utlf = new UserTaxListFactory(); $utlf->getByUserId($this->getUser()); if ($utlf->getRecordCount() > 0) { $this->user_tax_obj = $utlf->getCurrent(); return $this->user_tax_obj; } return FALSE; } }