예제 #1
0
 function CompanyDeductions($country = NULL, $province = NULL, $district = NULL, $industry = NULL)
 {
     //
     //Additional Information: http://www.payroll-taxes.com/state-tax.htm
     //
     //Get PayStub Link accounts
     $pseallf = TTnew('PayStubEntryAccountLinkListFactory');
     $pseallf->getByCompanyId($this->getCompany());
     if ($pseallf->getRecordCount() > 0) {
         $psea_obj = $pseallf->getCurrent();
     } else {
         Debug::text('Company ID: ' . $this->getCompany(), __FILE__, __LINE__, __METHOD__, 10);
         return FALSE;
     }
     require_once Environment::getBasePath() . '/classes/payroll_deduction/PayrollDeduction.class.php';
     $pd_obj = new PayrollDeduction($country, $province);
     $pd_obj->setDate(time());
     $cdf = TTnew('CompanyDeductionFactory');
     $cdf->StartTransaction();
     Debug::text('Country: ' . $country, __FILE__, __LINE__, __METHOD__, 10);
     if ($country != '' and $province == '') {
         switch ($country) {
             case 'ca':
                 $pd_obj = new PayrollDeduction($country, 'BC');
                 //Pick default province for now.
                 $pd_obj->setDate(time());
                 //Federal Income Tax
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'CA - Federal Income Tax', 'calculation_id' => 100, 'calculation_order' => 100, 'country' => strtoupper($country), 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'CA - Federal Income Tax'), 'user_value1' => $pd_obj->getBasicFederalClaimCodeAmount(), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'RRSP'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'Union Dues'))));
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'CA - Addl. Income Tax', 'calculation_id' => 20, 'calculation_order' => 105, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'CA - Addl. Income Tax'), 'user_value1' => 0));
                 //CPP
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'CPP - Employee', 'calculation_id' => 90, 'calculation_order' => 80, 'minimum_user_age' => 18, 'maximum_user_age' => 70, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'CPP'), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'))));
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'CPP - Employer', 'calculation_id' => 10, 'calculation_order' => 85, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, 'CPP - Employer'), 'include_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'CPP')), 'user_value1' => 100));
                 //EI
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'EI - Employee', 'calculation_id' => 91, 'calculation_order' => 90, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'EI'), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'))));
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'EI - Employer', 'calculation_id' => 10, 'calculation_order' => 95, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, 'EI - Employer'), 'include_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'EI')), 'user_value1' => 140));
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'WCB - Employer', 'calculation_id' => 15, 'calculation_order' => 96, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, 'WCB - Employer'), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement')), 'user_value1' => 0.0, 'user_value2' => 0, 'user_value3' => 0));
                 break;
             case 'us':
                 //Federal Income Tax
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'US - Federal Income Tax', 'calculation_id' => 100, 'calculation_order' => 100, 'country' => strtoupper($country), 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'US - Federal Income Tax'), 'user_value1' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'US - Addl. Income Tax', 'calculation_id' => 20, 'calculation_order' => 105, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'US - Federal Addl. Income Tax'), 'user_value1' => 0));
                 //Federal Unemployment Insurance.
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'US - Federal Unemployment Insurance', 'calculation_id' => 15, 'calculation_order' => 80, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, 'US - Federal Unemployment Insurance'), 'user_value1' => $pd_obj->getFederalUIMinimumRate(), 'user_value2' => $pd_obj->getFederalUIMaximumEarnings(), 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Social Security
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'Social Security - Employee', 'calculation_id' => 84, 'calculation_order' => 80, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'Social Security (FICA)'), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'Social Security - Employer', 'calculation_id' => 85, 'calculation_order' => 81, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, 'Social Security (FICA)'), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Medicare
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'Medicare - Employee', 'calculation_id' => 82, 'calculation_order' => 90, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'Medicare'), 'user_value1' => 10, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => 'Medicare - Employer', 'calculation_id' => 83, 'calculation_order' => 91, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, 'Medicare'), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
         }
         unset($pd_obj);
     }
     //Canada
     if ($country == 'ca' and $province != '') {
         $vacation_data = array('primary_percent' => 0, 'secondary_percent' => 0, 'secondary_length_of_service' => 0);
         Debug::text('Province: ' . $province, __FILE__, __LINE__, __METHOD__, 10);
         switch ($province) {
             //CA
             case 'bc':
             case 'ab':
             case 'mb':
             case 'qc':
             case 'nu':
             case 'nt':
                 $vacation_data = array('primary_percent' => 4, 'secondary_percent' => 6, 'secondary_length_of_service' => 6);
                 break;
             case 'nb':
             case 'ns':
             case 'pe':
                 $vacation_data = array('primary_percent' => 4, 'secondary_percent' => 6, 'secondary_length_of_service' => 9);
                 break;
             case 'on':
             case 'yt':
                 $vacation_data = array('primary_percent' => 4, 'secondary_percent' => 0, 'secondary_length_of_service' => 0);
                 break;
             case 'sk':
                 $vacation_data = array('primary_percent' => 4, 'secondary_percent' => 8, 'secondary_length_of_service' => 11);
                 break;
             case 'nl':
                 $vacation_data = array('primary_percent' => 4, 'secondary_percent' => 6, 'secondary_length_of_service' => 16);
                 break;
         }
         if (!in_array($province, array('on', 'yt'))) {
             $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 20, 'name' => strtoupper($province) . ' - Vacation Accrual - 0-' . ($vacation_data['secondary_length_of_service'] - 1) . ' Years', 'calculation_id' => 10, 'calculation_order' => 50, 'minimum_length_of_service_unit_id' => 40, 'minimum_length_of_service' => 0, 'maximum_length_of_service_unit_id' => 40, 'maximum_length_of_service' => $vacation_data['secondary_length_of_service'] - 0.003, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(50, 'Vacation Accrual'), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Vacation - Accrual Release'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Vacation - No Accrual'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Tips')), 'user_value1' => $vacation_data['primary_percent']));
         }
         $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 20, 'name' => strtoupper($province) . ' - Vacation Accrual - ' . ($vacation_data['secondary_length_of_service'] - 0) . '+ Years', 'calculation_id' => 10, 'calculation_order' => 51, 'minimum_length_of_service_unit_id' => 40, 'minimum_length_of_service' => $vacation_data['secondary_length_of_service'], 'maximum_length_of_service_unit_id' => 40, 'maximum_length_of_service' => 0, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(50, 'Vacation Accrual'), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Vacation - Accrual Release'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Vacation - No Accrual'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Tips')), 'user_value1' => $vacation_data['secondary_percent']));
         if (!in_array($province, array('on', 'yt'))) {
             $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 20, 'name' => strtoupper($province) . ' - Vacation No Accrual - 0-' . ($vacation_data['secondary_length_of_service'] - 1) . ' Years', 'calculation_id' => 10, 'calculation_order' => 50, 'minimum_length_of_service_unit_id' => 40, 'minimum_length_of_service' => 0, 'maximum_length_of_service_unit_id' => 40, 'maximum_length_of_service' => $vacation_data['secondary_length_of_service'] - 0.003, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Vacation - No Accrual'), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Vacation - Accrual Release'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Vacation - No Accrual'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Tips')), 'user_value1' => $vacation_data['primary_percent']));
         }
         $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 20, 'name' => strtoupper($province) . ' - Vacation No Accrual - ' . ($vacation_data['secondary_length_of_service'] - 0) . '+ Years', 'calculation_id' => 10, 'calculation_order' => 51, 'minimum_length_of_service_unit_id' => 40, 'minimum_length_of_service' => $vacation_data['secondary_length_of_service'], 'maximum_length_of_service_unit_id' => 40, 'maximum_length_of_service' => 0, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Vacation - No Accrual'), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Vacation - Accrual Release'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Vacation - No Accrual'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Tips')), 'user_value1' => $vacation_data['secondary_percent']));
         $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Provincial Income Tax', 'calculation_id' => 200, 'calculation_order' => 101, 'country' => strtoupper($country), 'province' => strtoupper($province), 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Provincial Income Tax'), 'user_value1' => $pd_obj->getBasicProvinceClaimCodeAmount(), 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'RRSP'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'Union Dues'))));
     }
     if ($country == 'us' and $province != '') {
         if (in_array($province, array('al', 'az', 'ar', 'ca', 'co', 'ct', 'de', 'dc', 'ga', 'hi', 'id', 'il', 'in', 'ia', 'ks', 'ky', 'la', 'me', 'md', 'ma', 'mi', 'mn', 'ms', 'mo', 'mt', 'ne', 'nj', 'nm', 'ny', 'nc', 'nd', 'oh', 'ok', 'or', 'pa', 'ri', 'sc', 'ut', 'vt', 'va', 'wi', 'wv'))) {
             //State Income Tax
             $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - State Income Tax', 'calculation_id' => 200, 'calculation_order' => 200, 'country' => strtoupper($country), 'province' => strtoupper($province), 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - State Income Tax'), 'user_value1' => 10, 'user_value2' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
             $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - State Addl. Income Tax', 'calculation_id' => 20, 'calculation_order' => 205, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - State Addl. Income Tax'), 'user_value1' => 0));
         }
         //Default to unemployment rates to 0.
         $company_state_unemployment_rate = 0;
         $company_state_unemployment_wage_base = 0;
         $state_unemployment_rate = 0;
         $state_unemployment_wage_base = 0;
         Debug::text('Province: ' . $province, __FILE__, __LINE__, __METHOD__, 10);
         switch ($province) {
             //US
             case 'al':
                 //alabama
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 8000;
                 //Employment Security Asmt
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Employment Security Assessment', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Employment Security Assessment'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'ak':
                 //alaska
                 //Unemployment Insurance - Employee
                 //Unemployment Insurance - Employer
                 $company_state_unemployment_wage_base = $state_unemployment_wage_base = 35800;
                 break;
             case 'az':
                 //arizona
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 7000;
                 //Surcharge
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Job Training Surcharge', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Job Training Surcharge'), 'user_value1' => 0.6, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'ar':
                 //arkansas
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 12000;
                 break;
             case 'ca':
                 //california
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 7000;
                 //Disability Insurance
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Disability Insurance', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Disability Insurance'), 'user_value1' => 1.0, 'user_value2' => 95585, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Employee Training Tax
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Employee Training Tax', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Employee Training Tax'), 'user_value1' => 0.1, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'co':
                 //colorado
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 11000;
                 break;
             case 'ct':
                 //connecticut
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 15000;
                 break;
             case 'de':
                 //delaware
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 10500;
                 break;
             case 'dc':
                 //d.c.
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 9000;
                 //Administrative Assessment
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Administrative Assessment', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Administrative Assessment'), 'user_value1' => 0.2, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'fl':
                 //florida
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 8000;
                 break;
             case 'ga':
                 //georgia
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 8500;
                 //Administrative Assessment
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Administrative Assessment', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Administrative Assessment'), 'user_value1' => 0.08, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'hi':
                 //hawaii
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 38800;
                 //E&T Assessment
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - E&T Assessment', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - E&T Assessment'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Health Insurance
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Health Insurance', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Health Insurance'), 'user_value1' => 0.0, 'user_value2' => 0, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Disability Insurance
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Disability Insurance', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Disability Insurance'), 'user_value1' => 0.0, 'user_value2' => 46970.56, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'id':
                 //idaho
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 34100;
                 //Administrative Reserve
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Administrative Reserve', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Administrative Reserve'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Workforce Development
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Workforce Development', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Workforce Development'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'il':
                 //illinois
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 13560;
                 break;
             case 'in':
                 //indiana
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 9500;
                 //County Tax
                 /*
                 $this->createPayStubAccount(
                 								array(
                 									'company_id' => $this->getCompany(),
                 									'status_id' => 10,
                 									'type_id' => 20,
                 									'name' => strtoupper($province) .' - County Income Tax',
                 									'ps_order' => 210,
                 								)
                 							);
                 */
                 break;
             case 'ia':
                 //iowa
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 25300;
                 //Reserve Fund
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Reserve Fund', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Reserve Fund'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Surcharge
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Surcharge', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Surcharge'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'ks':
                 //kansas
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 8000;
                 break;
             case 'ky':
                 //kentucky
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 9000;
                 break;
             case 'la':
                 //louisiana
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 7700;
                 break;
             case 'me':
                 //maine
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 12000;
                 //Competitive Skills
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Competitive Skills', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Competitive Skills'), 'user_value1' => 0.06, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'md':
                 //maryland
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 8500;
                 break;
             case 'ma':
                 //massachusetts
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 14000;
                 //Health Insurance
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Health Insurance', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Health Insurance'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Workforce Training Fund
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Workforce Training Fund', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Workforce Training Fund'), 'user_value1' => 0.06, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'mi':
                 //michigan
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 9500;
                 break;
             case 'mn':
                 //minnesota
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 28000;
                 //Workforce Enhancement Fee
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Workforce Enhancement Fee', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Workforce Enhancement Fee'), 'user_value1' => 0.1, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'ms':
                 //mississippi
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 14000;
                 //Training Contribution
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Training Contribution', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Training Contribution'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'mo':
                 //missouri
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 13000;
                 break;
             case 'mt':
                 //montana
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 27000;
                 //Administrative Fund
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Administrative Fund', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Administrative Fund'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'ne':
                 //nebraska
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 9000;
                 //SUIT
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - SUIT', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - SUIT'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'nv':
                 //nevada
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 26400;
                 //Career Enhancement
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Career Enhancement', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Career Enhancement'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'nh':
                 //new hampshire
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 14000;
                 //Administrative Contribution
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Administrative Contribution', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Administrative Contribution'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'nm':
                 //new mexico
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 22400;
                 //State Trust Fund
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - State Trust Fund', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - State Trust Fund'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'nj':
                 //new jersey
                 //Unemployment Insurance - Employee
                 //Unemployment Insurance - Employer
                 $state_unemployment_wage_base = 30300;
                 //Disability Insurance - Employee
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Disability Insurance - Employee', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Disability Insurance'), 'user_value1' => 0.2, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Disability Insurance - Employer
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Disability Insurance - Employer', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Disability Insurance'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Workforce Development - Employee
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Workforce Development - Employee', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Workforce Development'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Workforce Development - Employer
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Workforce Development - Employer', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Workforce Development'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Healthcare Subsidy - Employee
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Healthcare Subsidy - Employee', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Healthcare Subsidy'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Healthcare Subsidy - Employer
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Healthcare Subsidy - Employer', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Healthcare Subsidy'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Family Leave Insurance
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Family Leave Insurance', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Family Leave Insurance'), 'user_value1' => 0.08, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'ny':
                 //new york
                 //Unemployment Insurance - Employee
                 $company_state_unemployment_wage_base = $state_unemployment_wage_base = 8500;
                 //Reemployment Service Fund
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Reemployment Service Fund', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Reemployment Service Fund'), 'user_value1' => 0.075, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Disability Insurance - Employee
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Disability Insurance', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Disability Insurance'), 'user_value1' => 0.5, 'user_value2' => 0, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Disability Insurance - Male
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Disability Insurance - Male', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Disability Insurance - Male'), 'user_value1' => 0.0, 'user_value2' => 6000, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Disability Insurance - Female
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Disability Insurance - Female', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Disability Insurance - Female'), 'user_value1' => 0.0, 'user_value2' => 6000, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Metropolitan Commuter Tax
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Metropolitan Commuter Tax', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Metropolitan Commuter Tax'), 'user_value1' => 0.34, 'user_value2' => 0, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'nc':
                 //north carolina
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 20400;
                 break;
             case 'nd':
                 //north dakota
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 27900;
                 break;
             case 'oh':
                 //ohio
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 9000;
                 break;
             case 'ok':
                 //oklahoma
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 19100;
                 break;
             case 'or':
                 //oregon
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 33000;
                 //Workers Benefit - Employee
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Workers Benefit - Employee', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Workers Benefit'), 'user_value1' => 0.014, 'user_value2' => 0, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Workers Benefit - Employer
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Workers Benefit - Employer', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Workers Benefit'), 'user_value1' => 0.014, 'user_value2' => 0, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Tri-Met Transit District
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Tri-Met Transit District', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Tri-Met Transit District'), 'user_value1' => 0.7018, 'user_value2' => 0, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Lane Transit District
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Lane Transit District', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Lane Transit District'), 'user_value1' => 0.68, 'user_value2' => 0, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Special Payroll Tax offset
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Special Payroll Tax Offset', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Special Payroll Tax Offset'), 'user_value1' => 0.09, 'user_value2' => 0, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'pa':
                 //pennsylvania
                 //Unemployment Insurance - Employee
                 //Unemployment Insurance - Employer
                 $state_unemployment_wage_base = 0;
                 $company_state_unemployment_wage_base = 8000;
                 break;
             case 'ri':
                 //rhode island
                 //Employment Security
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Employment Security', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Employment Security'), 'user_value1' => 0.09, 'user_value2' => 19600, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Job Development Fund
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Job Development Fund', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Job Development Fund'), 'user_value1' => 0.51, 'user_value2' => 19600, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Temporary Disability Insurance
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Temporary Disability Insurance', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Temporary Disability Ins.'), 'user_value1' => 1.2, 'user_value2' => 60000, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'sc':
                 //south carolina
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 12000;
                 //Contingency Assessment
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Contingency Assessment', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Contingency Assessment'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'sd':
                 //south dakota
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 12000;
                 //Investment Fee
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Investment Fee', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Investment Fee'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //UI Surcharge
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - UI Surcharge', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - UI Surcharge'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'tn':
                 //tennessee
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 9000;
                 //Job Skills Fee
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Job Skills Fee', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Job Skills Fee'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'tx':
                 //texas
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 9000;
                 //Employment & Training
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Employment & Training', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Employment & Training'), 'user_value1' => 0.1, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //UI Obligation Assessment
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - UI Obligation Assessment', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - UI Obligation Assessment'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'ut':
                 //utah
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 29500;
                 break;
             case 'vt':
                 //vermont
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 16000;
                 break;
             case 'va':
                 //virginia
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 8000;
                 break;
             case 'wa':
                 //washington
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 38200;
                 //Industrial Insurance - Employee
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Industrial Insurance - Employee', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Industrial Insurance'), 'user_value1' => 0.0, 'user_value2' => 0, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Industrial Insurance - Employer
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Industrial Insurance - Employer', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Industrial Insurance'), 'user_value1' => 0.0, 'user_value2' => 0, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 //Employment Admin Fund
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Employment Admin Fund', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Employment Admin Fund'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
             case 'wv':
                 //west virginia
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 12000;
                 break;
             case 'wi':
                 //wisconsin
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 13000;
                 break;
             case 'wy':
                 //wyoming
                 //Unemployment Insurance - Employee
                 $state_unemployment_wage_base = 23000;
                 //Employment Support Fund
                 $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Employment Support Fund', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Employment Support Fund'), 'user_value1' => 0.0, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
                 break;
         }
         //Unemployment insurance must go below the above state settings so it has the proper rate/wage_base for
         //State Unemployement Insurace, deducted from employer
         if (in_array($province, array('ak', 'al', 'ar', 'az', 'ca', 'co', 'ct', 'dc', 'de', 'fl', 'ga', 'hi', 'ia', 'id', 'il', 'in', 'ks', 'ky', 'la', 'ma', 'md', 'me', 'mi', 'mn', 'mo', 'ms', 'mt', 'nc', 'nd', 'ne', 'nh', 'nj', 'nm', 'nv', 'ny', 'oh', 'ok', 'or', 'pa', 'sc', 'sd', 'tn', 'tx', 'ut', 'va', 'vt', 'wa', 'wi', 'wv', 'wy'))) {
             $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Unemployment Insurance - Employer', 'calculation_id' => 15, 'calculation_order' => 185, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(30, strtoupper($province) . ' - Unemployment Insurance'), 'user_value1' => $state_unemployment_rate, 'user_value2' => $state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
         }
         //State Unemployement Insurace, deducted from employee
         if (in_array($province, array('ak', 'nj', 'pa'))) {
             $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 10, 'name' => strtoupper($province) . ' - Unemployment Insurance - Employee', 'calculation_id' => 15, 'calculation_order' => 186, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, strtoupper($province) . ' - Unemployment Insurance'), 'user_value1' => $company_state_unemployment_rate, 'user_value2' => $company_state_unemployment_wage_base, 'user_value3' => 0, 'include_pay_stub_entry_account' => array($psea_obj->getTotalGross()), 'exclude_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Loan'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(10, 'Expense Reimbursement'), $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, '401(k)'))));
         }
     }
     //Default accounts, only created if country and province are not defined.
     if ($country == '' and $province == '' and $district == '') {
         $this->createCompanyDeduction(array('company_id' => $this->getCompany(), 'status_id' => 10, 'type_id' => 20, 'name' => 'Loan Repayment', 'calculation_id' => 52, 'calculation_order' => 200, 'pay_stub_entry_account_id' => $this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(20, 'Loan Repayment'), 'user_value1' => 25, 'user_value2' => 0, 'include_pay_stub_entry_account' => array($this->getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName(50, 'Loan Balance'))));
     }
     $cdf->CommitTransaction();
     return TRUE;
 }