function getPayStubId() { //Find which pay period this effective date belongs too $pplf = new PayPeriodListFactory(); $pplf->getByUserIdAndEndDate($this->getUser(), $this->getEffectiveDate()); if ($pplf->getRecordCount() > 0) { $pp_obj = $pplf->getCurrent(); Debug::text('Found Pay Period ID: ' . $pp_obj->getId(), __FILE__, __LINE__, __METHOD__, 10); //Percent PS amendments can't work on advances. $pslf = new PayStubListFactory(); $pslf->getByUserIdAndPayPeriodIdAndAdvance($this->getUser(), $pp_obj->getId(), FALSE); if ($pslf->getRecordCount() > 0) { $ps_obj = $pslf->getCurrent(); Debug::text('Found Pay Stub for this effective date: ' . $ps_obj->getId(), __FILE__, __LINE__, __METHOD__, 10); return $ps_obj->getId(); } } return FALSE; }