示例#1
0
 function preSave()
 {
     if ($this->isNew() and $this->getEnableReleaseAccruals() == TRUE) {
         //Create PS amendment releasing all accruals
         UserGenericStatusFactory::queueGenericStatus($this->getUserObject()->getFullName(TRUE) . ' - ' . TTi18n::gettext('Pay Stub Amendment'), 30, TTi18n::gettext('Releasing all employee accruals'), NULL);
         PayStubAmendmentFactory::releaseAllAccruals($this->getUser(), $this->getLastDate());
     }
     //Start these off as zero, until we can save this row, and re-calc them after
     //the final pay stub has been generated.
     if ($this->getInsurableHours() == '') {
         $this->setInsurableHours(0);
     }
     if ($this->getInsurableEarnings() == '') {
         $this->setInsurableEarnings(0);
     }
     return TRUE;
 }