function getPayStubEntryAccountLinkObject() { if (is_object($this->pay_stub_entry_account_link_obj)) { return $this->pay_stub_entry_account_link_obj; } else { $pseallf = new PayStubEntryAccountLinkListFactory(); $pseallf->getByCompanyID($this->getUserObject()->getCompany()); if ($pseallf->getRecordCount() > 0) { $this->pay_stub_entry_account_link_obj = $pseallf->getCurrent(); return $this->pay_stub_entry_account_link_obj; } return FALSE; } }
static function calculateLaborBurdenPercent($company_id, $user_id) { if ($company_id == '') { return FALSE; } if ($user_id == '') { return FALSE; } $end_epoch = TTDate::getTime(); $start_epoch = TTDate::getTime() - 86400 * 180; //6mths $retval = FALSE; $pseallf = new PayStubEntryAccountLinkListFactory(); $pseallf->getByCompanyID($company_id); if ($pseallf->getRecordCount() > 0) { $pself = new PayStubEntryListFactory(); $total_gross = $pself->getAmountSumByUserIdAndEntryNameIdAndStartDateAndEndDate($user_id, $pseallf->getCurrent()->getTotalGross(), $start_epoch, $end_epoch); $total_employer_deductions = $pself->getAmountSumByUserIdAndEntryNameIdAndStartDateAndEndDate($user_id, $pseallf->getCurrent()->getTotalEmployerDeduction(), $start_epoch, $end_epoch); if (isset($total_employer_deductions['amount']) and isset($total_gross['amount'])) { $retval = bcmul(bcdiv($total_employer_deductions['amount'], $total_gross['amount']), 100, 2); } } return $retval; }