function createPremiumPolicy($company_id, $type) { $ppf = new PremiumPolicyFactory(); $ppf->setCompany($company_id); switch ($type) { case 10: //Simple weekend premium $ppf->setName('Weekend'); $ppf->setType(10); $ppf->setPayType(20); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setMon(FALSE); $ppf->setTue(FALSE); $ppf->setWed(FALSE); $ppf->setThu(FALSE); $ppf->setFri(FALSE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setRate('1.33'); //$1.33 per hour $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); break; case 20: //Simple evening premium $ppf->setName('Evening'); $ppf->setType(10); $ppf->setPayType(10); //Pay multiplied by factor $ppf->setIncludePartialPunch(TRUE); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('5:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setMon(FALSE); $ppf->setTue(FALSE); $ppf->setWed(FALSE); $ppf->setThu(FALSE); $ppf->setFri(TRUE); $ppf->setSat(FALSE); $ppf->setSun(FALSE); $ppf->setWageGroup($this->user_wage_groups[0]); $ppf->setRate('1.50'); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 2')); break; } if ($ppf->isValid()) { $insert_id = $ppf->Save(); Debug::Text('Premium Policy ID: ' . $insert_id, __FILE__, __LINE__, __METHOD__, 10); return $insert_id; } Debug::Text('Failed Creating Premium Policy!', __FILE__, __LINE__, __METHOD__, 10); return FALSE; }
function createPremiumPolicy($company_id, $type, $accrual_policy_id = NULL) { $ppf = new PremiumPolicyFactory(); $ppf->setCompany($company_id); switch ($type) { case 90: //Basic Min/Max only. $ppf->setName('Min/Max Only'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(NULL); $ppf->setEndDate(NULL); $ppf->setStartTime(NULL); $ppf->setEndTime(NULL); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(3600); $ppf->setMaximumTime(7200); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 91: //Basic Min/Max only. as Advanced Type $ppf->setName('Min/Max Only'); $ppf->setType(100); //Advanced Type. $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(NULL); $ppf->setEndDate(NULL); $ppf->setStartTime(NULL); $ppf->setEndTime(NULL); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(3600); $ppf->setMaximumTime(7200); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 100: $ppf->setName('Start/End Date Only'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate($this->pay_period_objs[0]->getStartDate() + 86400); $ppf->setEndDate($this->pay_period_objs[0]->getStartDate() + 86400 * 3); //2nd & 3rd days. $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 110: $ppf->setName('Start/End Date+Effective Days'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate($this->pay_period_objs[0]->getStartDate() + 86400); $ppf->setEndDate($this->pay_period_objs[0]->getStartDate() + 86400 * 3); //2nd & 3rd days. $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 1 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 1) { $ppf->setMon(TRUE); } else { $ppf->setMon(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 2 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 2) { $ppf->setTue(TRUE); } else { $ppf->setTue(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 3 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 3) { $ppf->setWed(TRUE); } else { $ppf->setWed(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 4 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 4) { $ppf->setThu(TRUE); } else { $ppf->setThu(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 5 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 5) { $ppf->setFri(TRUE); } else { $ppf->setFri(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 6 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 6) { $ppf->setSat(TRUE); } else { $ppf->setSat(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 0 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 0) { $ppf->setSun(TRUE); } else { $ppf->setSun(FALSE); } $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 120: $ppf->setName('Time Based/Evening Shift w/Partial'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('7:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 122: $ppf->setName('Time Based/Evening Shift w/Partial+Span Midnight'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('6:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('3:00 AM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 123: $ppf->setName('Time Based/Weekend Day Shift w/Partial'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('7:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('7:00 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(FALSE); $ppf->setTue(FALSE); $ppf->setWed(FALSE); $ppf->setThu(FALSE); $ppf->setFri(FALSE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 124: //Same as above type: 122, only Advanced type. $ppf->setName('Time Based/Evening Shift w/Partial+Span Midnight'); $ppf->setType(100); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('6:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('3:00 AM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 125: //Same as above type: 123, only Advanced type. $ppf->setName('Time Based/Weekend Day Shift w/Partial'); $ppf->setType(100); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('7:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('7:00 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(FALSE); $ppf->setTue(FALSE); $ppf->setWed(FALSE); $ppf->setThu(FALSE); $ppf->setFri(FALSE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 126: //Same as above type: 122, only Advanced type. $ppf->setName('Time Based/Evening Shift w/Partial+Span Midnight'); $ppf->setType(100); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('10:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('12:00 AM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 127: $ppf->setName('Effective Days Only w/Partial'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(FALSE); $ppf->setTue(FALSE); $ppf->setWed(FALSE); $ppf->setThu(FALSE); $ppf->setFri(FALSE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(20); //Always on holidays. This is key to test for a specific bug. $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 130: $ppf->setName('Time Based/Evening Shift w/o Partial'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('7:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(FALSE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 132: $ppf->setName('Time Based/Evening Shift w/o Partial+Span Midnight'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('6:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('3:00 AM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(FALSE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 140: $ppf->setName('Daily Hour Based'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(3600 * 5); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 150: $ppf->setName('Weekly Hour Based'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(3600 * 9); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 160: $ppf->setName('Daily+Weekly Hour Based'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(3600 * 3); $ppf->setWeeklyTriggerTime(3600 * 9); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 170: $ppf->setName('Time+Daily+Weekly Hour Based'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('7:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(3600 * 5); $ppf->setWeeklyTriggerTime(3600 * 9); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 200: $ppf->setName('Branch Differential'); $ppf->setType(20); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); $ppf->setExcludeDefaultBranch(FALSE); $ppf->setExcludeDefaultDepartment(FALSE); $ppf->setBranchSelectionType(20); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 210: $ppf->setName('Branch/Department Differential'); $ppf->setType(20); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); $ppf->setExcludeDefaultBranch(FALSE); $ppf->setExcludeDefaultDepartment(FALSE); $ppf->setBranchSelectionType(20); $ppf->setDepartmentSelectionType(20); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 212: $ppf->setName('Branch/Department Differential w/Minimum'); $ppf->setType(20); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(3600); $ppf->setMaximumTime(3600); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); $ppf->setExcludeDefaultBranch(FALSE); $ppf->setExcludeDefaultDepartment(FALSE); $ppf->setBranchSelectionType(20); $ppf->setDepartmentSelectionType(20); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 300: $ppf->setName('Meal Break'); $ppf->setType(30); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setIncludePartialPunch(TRUE); $ppf->setDailyTriggerTime(3600 * 5); $ppf->setMaximumNoBreakTime(3600 * 5); $ppf->setMinimumBreakTime(1800); $ppf->setMinimumTime(1800); $ppf->setMaximumTime(1800); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 350: $ppf->setName('Minimum Shift Time'); $ppf->setType(50); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setMinimumShiftTime(4 * 3600); $ppf->setMinimumTimeBetweenShift(8 * 3600); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setBranchSelectionType( 20 ); break; case 351: $ppf->setName('Minimum Shift Time+Differential'); $ppf->setType(50); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setMinimumShiftTime(4 * 3600); $ppf->setMinimumTimeBetweenShift(8 * 3600); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); $ppf->setExcludeDefaultBranch(FALSE); $ppf->setExcludeDefaultDepartment(FALSE); $ppf->setBranchSelectionType(20); break; case 400: $ppf->setName('Holiday (Basic)'); $ppf->setType(90); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setIncludePartialPunch(TRUE); $ppf->setDailyTriggerTime(0); $ppf->setMaximumNoBreakTime(0); //$ppf->setMinimumBreakTime( 0 ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 410: $ppf->setName('Start/End Date+Effective Days+Always Holiday'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate($this->pay_period_objs[0]->getStartDate() + 86400); $ppf->setEndDate($this->pay_period_objs[0]->getStartDate() + 86400 * 3); //2nd & 3rd days. $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(FALSE); $ppf->setTue(FALSE); $ppf->setWed(FALSE); $ppf->setThu(FALSE); $ppf->setFri(FALSE); $ppf->setSat(FALSE); $ppf->setSun(FALSE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(20); //Always on holidays $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 412: $ppf->setName('Start/End Date+Effective Days+Never Holiday'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate($this->pay_period_objs[0]->getStartDate() + 86400); $ppf->setEndDate($this->pay_period_objs[0]->getStartDate() + 86400 * 3); //2nd & 3rd days. $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(30); //Never on holidays $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 414: $ppf->setName('Weekly+Never Holiday'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(3600 * 40); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(30); //Never on Holiday $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 500: $ppf->setName('Daily Before/After Time 8-10hrs'); $ppf->setType(10); $ppf->setPayType(10); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(8 * 3600); $ppf->setMaximumDailyTriggerTime(10 * 3600); $ppf->setWeeklyTriggerTime(0); $ppf->setMaximumWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(10); //No effect. $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); break; case 501: $ppf->setName('Daily Before/After Time 10-11hrs'); $ppf->setType(10); $ppf->setPayType(10); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(10 * 3600); $ppf->setMaximumDailyTriggerTime(11 * 3600); $ppf->setWeeklyTriggerTime(0); $ppf->setMaximumWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(10); //No effect. $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); break; case 510: $ppf->setName('Weekly Before/After Time 20-30hrs'); $ppf->setType(10); $ppf->setPayType(10); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(0); $ppf->setMaximumDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(20 * 3600); $ppf->setMaximumWeeklyTriggerTime(30 * 3600); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(10); //No effect. $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); break; case 511: $ppf->setName('Weekly Before/After Time 30-40hrs'); $ppf->setType(10); $ppf->setPayType(10); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(0); $ppf->setMaximumDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(30 * 3600); $ppf->setMaximumWeeklyTriggerTime(40 * 3600); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(10); //No effect. $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); break; case 520: $ppf->setName('Daily After 8/Weekly Before 40'); $ppf->setType(10); $ppf->setPayType(10); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(8 * 3600); $ppf->setMaximumDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMaximumWeeklyTriggerTime(40 * 3600); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(10); //No effect. $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); break; case 521: $ppf->setName('Daily After 8/Weekly After 40'); $ppf->setType(10); $ppf->setPayType(10); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(8 * 3600); $ppf->setMaximumDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(40 * 3600); $ppf->setMaximumWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(10); //No effect. $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); break; case 522: $ppf->setName('Daily Before 8/Weekly After 40'); $ppf->setType(10); $ppf->setPayType(10); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(0); $ppf->setMaximumDailyTriggerTime(8 * 3600); $ppf->setWeeklyTriggerTime(40 * 3600); $ppf->setMaximumWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(10); //No effect. $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); break; case 523: $ppf->setName('Weekly Before 40'); $ppf->setType(10); $ppf->setPayType(10); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(0); $ppf->setMaximumDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMaximumWeeklyTriggerTime(40 * 3600); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(10); //No effect. $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); break; case 524: $ppf->setName('Daily Before 8/Weekly Before 40'); $ppf->setType(10); $ppf->setPayType(10); $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(''); $ppf->setEndTime(''); $ppf->setDailyTriggerTime(0); $ppf->setMaximumDailyTriggerTime(8 * 3600); $ppf->setWeeklyTriggerTime(0); $ppf->setMaximumWeeklyTriggerTime(40 * 3600); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setIncludeHolidayType(10); //No effect. $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); break; case 600: $ppf->setName('Last second of day'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 1) { $ppf->setMon(TRUE); } else { $ppf->setMon(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 2) { $ppf->setTue(TRUE); } else { $ppf->setTue(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 3) { $ppf->setWed(TRUE); } else { $ppf->setWed(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 4) { $ppf->setThu(TRUE); } else { $ppf->setThu(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 5) { $ppf->setFri(TRUE); } else { $ppf->setFri(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 6) { $ppf->setSat(TRUE); } else { $ppf->setSat(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 0) { $ppf->setSun(TRUE); } else { $ppf->setSun(FALSE); } $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 700: $ppf->setName('Advanced Active After + Differential'); $ppf->setType(100); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setDailyTriggerTime(3600 * 8); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); $ppf->setExcludeDefaultBranch(FALSE); $ppf->setExcludeDefaultDepartment(FALSE); $ppf->setBranchSelectionType(20); $ppf->setDepartmentSelectionType(20); break; case 723: //Same as 724 $ppf->setName('Advanced Weekly Before 40A + Diff'); $ppf->setType(100); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setDailyTriggerTime(0); $ppf->setMaximumDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMaximumWeeklyTriggerTime(40 * 3600); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); $ppf->setExcludeDefaultBranch(FALSE); $ppf->setExcludeDefaultDepartment(FALSE); $ppf->setBranchSelectionType(20); $ppf->setDepartmentSelectionType(20); break; case 724: //Same as 723 $ppf->setName('Advanced Weekly Before 40B + Diff'); $ppf->setType(100); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setDailyTriggerTime(0); $ppf->setMaximumDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMaximumWeeklyTriggerTime(40 * 3600); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); $ppf->setExcludeDefaultBranch(FALSE); $ppf->setExcludeDefaultDepartment(FALSE); $ppf->setBranchSelectionType(20); $ppf->setDepartmentSelectionType(20); break; case 729: $ppf->setName('Advanced Daily Before 8/Weekly Before 40 + Diff'); $ppf->setType(100); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setDailyTriggerTime(0); $ppf->setMaximumDailyTriggerTime(8 * 3600); $ppf->setWeeklyTriggerTime(0); $ppf->setMaximumWeeklyTriggerTime(40 * 3600); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); $ppf->setExcludeDefaultBranch(FALSE); $ppf->setExcludeDefaultDepartment(FALSE); $ppf->setBranchSelectionType(20); $ppf->setDepartmentSelectionType(20); break; } if ($ppf->isValid()) { $insert_id = $ppf->Save(FALSE); Debug::Text('Premium Policy ID: ' . $insert_id, __FILE__, __LINE__, __METHOD__, 10); switch ($type) { case 200: Debug::Text('Post Save Data...', __FILE__, __LINE__, __METHOD__, 10); $ppf->setBranch(array($this->branch_ids[0])); break; case 210: case 351: Debug::Text('Post Save Data...', __FILE__, __LINE__, __METHOD__, 10); $ppf->setBranch(array($this->branch_ids[0])); $ppf->setDepartment(array($this->department_ids[0])); break; case 700: Debug::Text('Post Save Data...', __FILE__, __LINE__, __METHOD__, 10); $ppf->setBranch(array($this->branch_ids[0])); $ppf->setDepartment(array($this->department_ids[0])); break; case 723: Debug::Text('Post Save Data...', __FILE__, __LINE__, __METHOD__, 10); $ppf->setBranch(array($this->branch_ids[0])); $ppf->setDepartment(array($this->department_ids[0])); break; case 724: //Same as 729. //Same as 729. case 729: Debug::Text('Post Save Data...', __FILE__, __LINE__, __METHOD__, 10); $ppf->setBranch(array($this->branch_ids[1])); $ppf->setDepartment(array($this->department_ids[1])); break; } Debug::Text('Post Save...', __FILE__, __LINE__, __METHOD__, 10); $ppf->Save(); return $insert_id; } Debug::Text('Failed Creating Premium Policy!', __FILE__, __LINE__, __METHOD__, 10); return FALSE; }
function createPremiumPolicy($company_id, $type, $accrual_policy_id = NULL) { $ppf = new PremiumPolicyFactory(); $ppf->setCompany($company_id); switch ($type) { case 90: //Basic Min/Max only. $ppf->setName('Min/Max Only'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(NULL); $ppf->setEndDate(NULL); $ppf->setStartTime(NULL); $ppf->setEndTime(NULL); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(3600); $ppf->setMaximumTime(7200); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 100: $ppf->setName('Start/End Date Only'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate($this->pay_period_objs[0]->getStartDate() + 86400); $ppf->setEndDate($this->pay_period_objs[0]->getStartDate() + 86400 * 3); //2nd & 3rd days. $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 110: $ppf->setName('Start/End Date+Effective Days'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate($this->pay_period_objs[0]->getStartDate() + 86400); $ppf->setEndDate($this->pay_period_objs[0]->getStartDate() + 86400 * 3); //2nd & 3rd days. $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 1 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 1) { $ppf->setMon(TRUE); } else { $ppf->setMon(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 2 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 2) { $ppf->setTue(TRUE); } else { $ppf->setTue(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 3 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 3) { $ppf->setWed(TRUE); } else { $ppf->setWed(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 4 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 4) { $ppf->setThu(TRUE); } else { $ppf->setThu(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 5 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 5) { $ppf->setFri(TRUE); } else { $ppf->setFri(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 6 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 6) { $ppf->setSat(TRUE); } else { $ppf->setSat(FALSE); } if (TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 2) == 0 or TTDate::getDayOfWeek($this->pay_period_objs[0]->getStartDate() + 86400 * 3) == 0) { $ppf->setSun(TRUE); } else { $ppf->setSun(FALSE); } $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 120: $ppf->setName('Time Based/Evening Shift w/Partial'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('7:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 122: $ppf->setName('Time Based/Evening Shift w/Partial+Span Midnight'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('6:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('3:00 AM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 123: $ppf->setName('Time Based/Weekend Day Shift w/Partial'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('7:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('7:00 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(FALSE); $ppf->setTue(FALSE); $ppf->setWed(FALSE); $ppf->setThu(FALSE); $ppf->setFri(FALSE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 130: $ppf->setName('Time Based/Evening Shift w/o Partial'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('7:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(FALSE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 132: $ppf->setName('Time Based/Evening Shift w/o Partial+Span Midnight'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('6:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('3:00 AM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(FALSE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 140: $ppf->setName('Daily Hour Based'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(3600 * 5); $ppf->setWeeklyTriggerTime(0); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 150: $ppf->setName('Weekly Hour Based'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(0); $ppf->setWeeklyTriggerTime(3600 * 9); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 160: $ppf->setName('Daily+Weekly Hour Based'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('12:00 AM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(3600 * 3); $ppf->setWeeklyTriggerTime(3600 * 9); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 170: $ppf->setName('Time+Daily+Weekly Hour Based'); $ppf->setType(10); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setStartDate(''); $ppf->setEndDate(''); $ppf->setStartTime(TTDate::parseDateTime('7:00 PM')); $ppf->setEndTime(TTDate::parseDateTime('11:59 PM')); $ppf->setDailyTriggerTime(3600 * 5); $ppf->setWeeklyTriggerTime(3600 * 9); $ppf->setMon(TRUE); $ppf->setTue(TRUE); $ppf->setWed(TRUE); $ppf->setThu(TRUE); $ppf->setFri(TRUE); $ppf->setSat(TRUE); $ppf->setSun(TRUE); $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setExcludeDefaultBranch( FALSE ); //$ppf->setExcludeDefaultDepartment( FALSE ); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 200: $ppf->setName('Branch Differential'); $ppf->setType(20); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); $ppf->setExcludeDefaultBranch(FALSE); $ppf->setExcludeDefaultDepartment(FALSE); $ppf->setBranchSelectionType(20); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 210: $ppf->setName('Branch/Department Differential'); $ppf->setType(20); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setIncludePartialPunch(TRUE); //$ppf->setMaximumNoBreakTime( $data['maximum_no_break_time'] ); //$ppf->setMinimumBreakTime( $data['minimum_break_time'] ); $ppf->setMinimumTime(0); $ppf->setMaximumTime(0); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); $ppf->setExcludeDefaultBranch(FALSE); $ppf->setExcludeDefaultDepartment(FALSE); $ppf->setBranchSelectionType(20); $ppf->setDepartmentSelectionType(20); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; case 300: $ppf->setName('Meal Break'); $ppf->setType(30); $ppf->setPayType(10); //Pay Multiplied by factor $ppf->setIncludePartialPunch(TRUE); $ppf->setDailyTriggerTime(3600 * 5); $ppf->setMaximumNoBreakTime(3600 * 5); $ppf->setMinimumBreakTime(1800); $ppf->setMinimumTime(1800); $ppf->setMaximumTime(1800); $ppf->setIncludeMealPolicy(TRUE); $ppf->setRate(1.0); $ppf->setPayStubEntryAccountId(CompanyDeductionFactory::getPayStubEntryAccountByCompanyIDAndTypeAndFuzzyName($company_id, 10, 'Premium 1')); //$ppf->setJobGroupSelectionType( 10 ); //$ppf->setJobSelectionType( 10 ); //$ppf->setJobItemGroupSelectionType( 10 ); //$ppf->setJobItemSelectionType( 10 ); break; } if ($ppf->isValid()) { $insert_id = $ppf->Save(FALSE); Debug::Text('Premium Policy ID: ' . $insert_id, __FILE__, __LINE__, __METHOD__, 10); switch ($type) { case 200: Debug::Text('Post Save Data...', __FILE__, __LINE__, __METHOD__, 10); $ppf->setBranch(array($this->branch_ids[0])); break; case 210: Debug::Text('Post Save Data...', __FILE__, __LINE__, __METHOD__, 10); $ppf->setBranch(array($this->branch_ids[0])); $ppf->setDepartment(array($this->department_ids[0])); break; } Debug::Text('Post Save...', __FILE__, __LINE__, __METHOD__, 10); $ppf->Save(); return $insert_id; } Debug::Text('Failed Creating Premium Policy!', __FILE__, __LINE__, __METHOD__, 10); return FALSE; }
$action = Misc::findSubmitButton(); switch ($action) { case 'submit': //Debug::setVerbosity(11); Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10); $ppf->StartTransaction(); $ppf->setId($data['id']); $ppf->setCompany($current_company->getId()); $ppf->setName($data['name']); $ppf->setType($data['type_id']); $ppf->setPayType($data['pay_type_id']); if ($data['type_id'] == 10 or $data['type_id'] == 100) { $ppf->setStartDate($data['start_date']); $ppf->setEndDate($data['end_date']); $ppf->setStartTime($data['start_time']); $ppf->setEndTime($data['end_time']); $ppf->setDailyTriggerTime($data['daily_trigger_time']); $ppf->setWeeklyTriggerTime($data['weekly_trigger_time']); if (isset($data['mon'])) { $ppf->setMon(TRUE); } else { $ppf->setMon(FALSE); } if (isset($data['tue'])) { $ppf->setTue(TRUE); } else { $ppf->setTue(FALSE); } if (isset($data['wed'])) { $ppf->setWed(TRUE); } else {