} $columns = array_merge($columns, $otp_columns); } //Get all Premium policies. $pplf = new PremiumPolicyListFactory(); $pplf->getByCompanyId($current_company->getId()); if ($pplf->getRecordCount() > 0) { foreach ($pplf as $pp_obj) { $pp_columns['premium_policy-' . $pp_obj->getId()] = $pp_obj->getName(); } $columns = array_merge($columns, $pp_columns); } //Get all Absence Policies. $aplf = new AbsencePolicyListFactory(); $aplf->getByCompanyId($current_company->getId()); if ($aplf->getRecordCount() > 0) { foreach ($aplf as $ap_obj) { $ap_columns['absence_policy-' . $ap_obj->getId()] = $ap_obj->getName(); } $columns = array_merge($columns, $ap_columns); } $default_start_date = TTDate::getBeginMonthEpoch(); $default_end_date = TTDate::getEndMonthEpoch(); //Get all pay periods $pplf = new PayPeriodListFactory(); $pplf->getByCompanyId($current_company->getId()); if ($pplf->getRecordCount() > 0) { $pp = 0; foreach ($pplf as $pay_period_obj) { $pay_period_ids[] = $pay_period_obj->getId(); $pay_period_end_dates[$pay_period_obj->getId()] = $pay_period_obj->getEndDate();
function getAbsencePolicyObject() { if (is_object($this->absence_policy_obj)) { return $this->absence_policy_obj; } else { $aplf = new AbsencePolicyListFactory(); $aplf->getById($this->getAbsencePolicyID()); if ($aplf->getRecordCount() > 0) { $this->absence_policy_obj = $aplf->getCurrent(); } return $this->absence_policy_obj; } }
function getAbsencePolicyBalance($absence_policy_id, $user_id) { global $current_company; if (!is_object($current_company)) { return FALSE; } $aplf = new AbsencePolicyListFactory(); $aplf->getByIdAndCompanyId($absence_policy_id, $current_company->getId()); if ($aplf->getRecordCount() > 0) { $ap_obj = $aplf->getCurrent(); if ($ap_obj->getAccrualPolicyID() != '') { return $this->getAccrualBalance($ap_obj->getAccrualPolicyID(), $user_id); } } return FALSE; }