getVersion(), __FILE__, __LINE__, __METHOD__, 9 ); return true; } /** * @return bool */ function postInstall() { Debug::text( 'postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9 ); //Go through all employee wages and update HourlyRate to the accurate annual hourly rate. //Take into account wage entries that don't have the proper effective date based on the employees hire date, force a correct effective_date. $uwlf = TTnew( 'UserWageListFactory' ); /** @var UserWageListFactory $uwlf */ $uwlf->getAll(); if ( $uwlf->getRecordCount() > 0 ) { foreach ( $uwlf as $uw_obj ) { $uw_obj->setHourlyRate( $uw_obj->calcHourlyRate( time(), true ) ); if ( $uw_obj->getWageGroup() == 0 && $uw_obj->isValidEffectiveDate( $uw_obj->getEffectiveDate() ) == false ) { //Set wage effective date to employees hire date. $u_obj = $uw_obj->getUserObject(); if ( is_object( $u_obj ) ) { $uw_obj->setEffectiveDate( $u_obj->getHireDate() ); } } if ( $uw_obj->isValid() ) { $uw_obj->Save(); } } } return true; } } ?>