static function addPresets($company_id) { if ($company_id == '') { Debug::text('Company ID: ' . $company_id, __FILE__, __LINE__, __METHOD__, 10); return FALSE; } $clf = new CompanyListFactory(); $clf->getById($company_id); if ($clf->getRecordCount() > 0) { $company_obj = $clf->getCurrent(); $country = $company_obj->getCountry(); $province = $company_obj->getProvince(); } else { Debug::text('bCompany ID: ' . $company_id, __FILE__, __LINE__, __METHOD__, 10); return FALSE; } //Get PayStub Link accounts $pseallf = new PayStubEntryAccountLinkListFactory(); $pseallf->getByCompanyId($company_id); if ($pseallf->getRecordCount() > 0) { $psea_obj = $pseallf->getCurrent(); } else { Debug::text('cCompany ID: ' . $company_id, __FILE__, __LINE__, __METHOD__, 10); return FALSE; } require_once Environment::getBasePath() . '/classes/payroll_deduction/PayrollDeduction.class.php'; $cdf = new CompanyDeductionFactory(); $cdf->StartTransaction(); /* 10 => 'Percent', 15 => 'Advanced Percent', 20 => 'Fixed Amount', //Federal 100 => 'Federal Income Tax Formula', //Province/State 200 => 'Province/State Income Tax Formula', 210 => 'Province/State UI Formula', */ Debug::text('Country: ' . $country, __FILE__, __LINE__, __METHOD__, 10); switch (strtolower($country)) { case 'ca': $pd_obj = new PayrollDeduction($country, 'BC'); //Pick default province for now. $pd_obj->setDate(time()); $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('Federal Income Tax'); $cdf->setCalculation(100); $cdf->setCalculationOrder(100); $cdf->setCountry('CA'); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, '%Federal Income%')); $cdf->setUserValue1($pd_obj->getBasicFederalClaimCodeAmount()); if ($cdf->isValid()) { $cdf->Save(FALSE); $exclude_ids = array(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'Union')); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); //var_dump($exclude_ids); $cdf->setExcludePayStubEntryAccount($exclude_ids); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('Additional Income Tax'); $cdf->setCalculation(20); $cdf->setCalculationOrder(105); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, '%Additional Income Tax%')); $cdf->setUserValue1(0); if ($cdf->isValid()) { $cdf->Save(FALSE); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('CPP - Employee'); $cdf->setCalculation(90); // CPP Formula $cdf->setCalculationOrder(80); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'CPP')); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('CPP - Employer'); $cdf->setCalculation(10); $cdf->setCalculationOrder(85); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, '%CPP - Employer%')); $cdf->setUserValue1(100); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'CPP'))); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('EI - Employee'); $cdf->setCalculation(91); //EI Formula $cdf->setCalculationOrder(90); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'EI')); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('EI - Employer'); $cdf->setCalculation(10); $cdf->setCalculationOrder(95); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, '%EI - Employer%')); $cdf->setUserValue1(140); //2006 if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'EI'))); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('WCB - Employer'); $cdf->setCalculation(15); $cdf->setCalculationOrder(95); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, '%WCB%')); $cdf->setUserValue1(0.0); //Default $cdf->setUserValue2(0); //Annual Wage Base: WCB has this, but can differ between rates/classifications. $cdf->setUserValue3(0); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(20); //Deduction $cdf->setName('Vacation Accrual'); $cdf->setCalculation(10); $cdf->setCalculationOrder(50); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 50, 'Vacation Accrual')); $cdf->setUserValue1(4); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); $exclude_ids = array(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Vacation Accrual Release'), self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Vacation Time')); $cdf->setExcludePayStubEntryAccount($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(20); //Deduction $cdf->setName('Vacation Release'); $cdf->setCalculation(10); $cdf->setCalculationOrder(51); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Vacation Accrual Release')); $cdf->setUserValue1(4); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); $exclude_ids = array(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Vacation Accrual Release'), self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Vacation Time')); $cdf->setExcludePayStubEntryAccount($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'us': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('Federal Income Tax'); $cdf->setCalculation(100); $cdf->setCalculationOrder(100); $cdf->setCountry('US'); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, '%Federal Income%')); $cdf->setUserValue1(10); //Single $cdf->setUserValue2(1); //0 Allowances if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('Advance Earned Income Credit (EIC)'); $cdf->setCalculation(80); $cdf->setCalculationOrder(105); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, '%Advance EIC%')); $cdf->setUserValue1(10); //Single if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('Federal Unemployment Insurance - Employer'); $cdf->setCalculation(15); $cdf->setCalculationOrder(80); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'Fed. Unemployment Ins.')); $cdf->setUserValue1(0.8); //2009 $cdf->setUserValue2(7000); $cdf->setUserValue3(0); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('Social Security - Employee'); $cdf->setCalculation(15); $cdf->setCalculationOrder(80); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'Social Security (FICA)')); $cdf->setUserValue1(6.2); //2009 $cdf->setUserValue2(106800); $cdf->setUserValue3(0); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('Social Security - Employer'); $cdf->setCalculation(10); $cdf->setCalculationOrder(85); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'Social Security%')); $cdf->setUserValue1(100); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'Social Security (FICA)'))); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('Medicare - Employee'); $cdf->setCalculation(10); $cdf->setCalculationOrder(90); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'Medicare')); $cdf->setUserValue1(1.45); //2009 if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('Medicare - Employer'); $cdf->setCalculation(10); $cdf->setCalculationOrder(95); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'Medicare')); $cdf->setUserValue1(100); if ($cdf->isValid()) { $cdf->Save(FALSE); //$cdf->setIncludePayStubEntryAccount( array( $psea_obj->getTotalGross() )); $cdf->setIncludePayStubEntryAccount(array(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'Medicare'))); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'cr': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(TTi18n::gettext('Income Tax')); $cdf->setCalculation(100); $cdf->setCalculationOrder(100); $cdf->setCountry('CR'); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, '%Federal Income%')); $cdf->setUserValue1(10); //Single $cdf->setUserValue2(0); //0 Allowances if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; } $pd_obj = new PayrollDeduction($country, $province); $pd_obj->setDate(time()); Debug::text('Province/State: ' . $province, __FILE__, __LINE__, __METHOD__, 10); switch (strtolower($province)) { //Canada case 'ab': case 'bc': case 'sk': case 'mb': case 'qc': case 'on': case 'nl': case 'nb': case 'ns': case 'pe': case 'nt': case 'yt': case 'nu': $provincial_claim_amount = $pd_obj->getBasicProvinceClaimCodeAmount(); break; //US //US case 'al': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(8000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ak': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance - Employer'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(32700); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance - Employee'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(32700); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ar': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(10000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'az': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(7000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Job Training'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Employee Training')); $cdf->setUserValue1(0.1); //2009 $cdf->setUserValue2(7000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ca': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Disability Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(180); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'State Disability Ins.')); $cdf->setUserValue1(1.1); //2009 $cdf->setUserValue2(90669); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0); //2009 $cdf->setUserValue2(7000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Employee Training'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Employee Training')); $cdf->setUserValue1(0.1); //2009 $cdf->setUserValue2(7000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'co': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(10000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ct': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(15000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'dc': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(9000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'de': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(10500); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'fl': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(7000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ga': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(8500); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'hi': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(13000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ia': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(23700); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'id': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(33200); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'il': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins. - Employer')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(12300); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'in': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(7000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ks': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(8000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ky': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(8000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'la': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(7000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ma': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(14000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'md': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(8500); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'me': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(12000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'mi': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(9000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'mn': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(26000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'mo': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(12500); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ms': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(7000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'mt': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(25100); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'nc': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(19300); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'nd': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(23700); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'nh': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(8000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ne': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(9000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'nj': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(28900); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(28900); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'nm': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(20900); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'nv': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(26600); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ny': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0); //2009 $cdf->setUserValue2(8500); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Reemployment Service Fund'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Reemployment')); $cdf->setUserValue1(0.075); //2009 $cdf->setUserValue2(8500); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Disability Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(180); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'State Disability Ins.')); $cdf->setUserValue1(0.5); //2009 $cdf->setUserValue2(0); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'oh': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(9000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ok': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(14200); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'or': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Insurance')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(31300); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'pa': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(8000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ri': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Employment Security'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(18000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'sc': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(7000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'sd': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(9500); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'tn': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(7000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'tx': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0); //2009 $cdf->setUserValue2(9000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Employee Training'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Employee Training')); $cdf->setUserValue1(0.0); //2006 $cdf->setUserValue2(9000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'ut': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(27800); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'va': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(8000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'vt': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(8000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'wa': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(37500); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'wi': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(12000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'wv': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(8000); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; case 'wy': $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Unemployment Insurance'); $cdf->setCalculation(15); $cdf->setCalculationOrder(185); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 30, 'State Unemployment Ins.')); $cdf->setUserValue1(0.0); //2009 $cdf->setUserValue2(21500); if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } break; } if ($country == 'CA') { $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName(strtoupper($province) . ' - Provincial Income Tax'); $cdf->setCalculation(200); $cdf->setCalculationOrder(110); $cdf->setCountry('CA'); $cdf->setProvince(strtoupper($province)); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, '%Provincial Income%')); $cdf->setUserValue1($provincial_claim_amount); if ($cdf->isValid()) { $cdf->Save(FALSE); $exclude_ids = array(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, 'Union')); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); $cdf->setExcludePayStubEntryAccount($exclude_ids); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } } elseif ($country = 'US') { $cdf = new CompanyDeductionFactory(); $cdf->setCompany($company_id); $cdf->setStatus(10); //Enabled $cdf->setType(10); //Tax $cdf->setName('State Income Tax'); $cdf->setCalculation(200); $cdf->setCalculationOrder(200); $cdf->setCountry('US'); $cdf->setProvince(strtoupper($province)); $cdf->setPayStubEntryAccount(self::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 20, '%State Income%')); $cdf->setUserValue1(10); //Single $cdf->setUserValue2(1); //0 Allowances if ($cdf->isValid()) { $cdf->Save(FALSE); $cdf->setIncludePayStubEntryAccount(array($psea_obj->getTotalGross())); unset($exclude_ids); if ($cdf->isValid()) { $cdf->Save(); } } } $cdf->CommitTransaction(); //$cdf->FailTransaction(); return TRUE; }
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; }