*/
/*
 * Adds time to employee accruals based on calendar milestones
 * This file should run once a day.
 *
 */
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'global.inc.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'CLI.inc.php';
//Debug::setVerbosity(11);
$current_epoch = TTDate::getTime();
//$current_epoch = strtotime('28-Dec-07 1:00 AM');
$offset = 86400 - 3600 * 2;
//22hrs of variance. Must be less than 24hrs which is how often this script runs.
$clf = new CompanyListFactory();
$clf->getAll();
if ($clf->getRecordCount() > 0) {
    foreach ($clf as $c_obj) {
        if ($c_obj->getStatus() != 30) {
            $aplf = new AccrualPolicyListFactory();
            $aplf->getByCompanyIdAndTypeId($c_obj->getId(), array(20, 30));
            //Include hour based accruals so rollover adjustments can be calculated.
            if ($aplf->getRecordCount() > 0) {
                foreach ($aplf as $ap_obj) {
                    $ap_obj->addAccrualPolicyTime($current_epoch, $offset);
                }
            }
        }
    }
}
Debug::writeToLog();
Debug::Display();
 * $Date: 2006-12-06 14:58:53 -0800 (Wed, 06 Dec 2006) $
 */
/*
 * Adds time to employee accruals based on calendar milestones
 * This file should run once a day.
 *
 */
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'global.inc.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'CLI.inc.php';
//Debug::setVerbosity(11);
$current_epoch = TTDate::getTime();
//$current_epoch = strtotime('28-Dec-07 1:00 AM');
$offset = 86400 - 3600 * 2;
//22hrs of variance. Must be less than 24hrs which is how often this script runs.
$clf = new CompanyListFactory();
$clf->getAll();
if ($clf->getRecordCount() > 0) {
    foreach ($clf as $c_obj) {
        if ($c_obj->getStatus() != 30) {
            $aplf = new AccrualPolicyListFactory();
            $aplf->getByCompanyIdAndTypeId($c_obj->getId(), 20);
            if ($aplf->getRecordCount() > 0) {
                foreach ($aplf as $ap_obj) {
                    $ap_obj->addAccrualPolicyTime($current_epoch, $offset);
                }
            }
        }
    }
}
Debug::writeToLog();
Debug::Display();