$end_date = $filter_data['end_date'];
 }
 $uwlf = new UserWageListFactory();
 $uwlf->getLastWageByUserIdAndDate($filter_data['user_id'], $end_date);
 if ($uwlf->getRecordCount() > 0) {
     foreach ($uwlf as $uw_obj) {
         $user_wage[$uw_obj->getUser()] = $uw_obj->getBaseCurrencyHourlyRate($uw_obj->getHourlyRate());
     }
 }
 unset($end_date);
 //var_dump($user_wage);
 $pending_requests = array();
 if (isset($filter_data['pay_period_ids']) and count($filter_data['pay_period_ids']) > 0) {
     //Get all pending requests
     $rlf = new RequestListFactory();
     $rlf->getSumByPayPeriodIdAndStatus($filter_data['pay_period_ids'], 30);
     if ($rlf->getRecordCount() > 0) {
         $r_obj = $rlf->getCurrent();
         $pending_requests[$r_obj->getColumn('pay_period_id')] = $r_obj->getColumn('total');
     }
 }
 $slf = new ScheduleListFactory();
 //$slf->getReportByPayPeriodIdAndUserId($filter_data['pay_period_ids'], $filter_data['user_ids']);
 $slf->getReportByCompanyIdAndArrayCriteria($current_company->getId(), $filter_data);
 if ($slf->getRecordCount() > 0) {
     foreach ($slf as $s_obj) {
         $user_id = $s_obj->getColumn('user_id');
         $pay_period_id = $s_obj->getColumn('pay_period_id');
         $status_id = $s_obj->getColumn('status_id');
         $status = strtolower(Option::getByKey($status_id, $s_obj->getOptions('status')));
         $schedule_rows[$user_id][$pay_period_id][$status] = $s_obj->getColumn('total_time');
示例#2
0
                        $exceptions['low'] = $e_obj->getColumn('count');
                    }
                    if ($e_obj->getColumn('severity_id') == 20) {
                        $exceptions['med'] = $e_obj->getColumn('count');
                    }
                    if ($e_obj->getColumn('severity_id') == 30) {
                        $exceptions['high'] = $e_obj->getColumn('count');
                    }
                }
            } else {
                Debug::Text(' No Exceptions!', __FILE__, __LINE__, __METHOD__, 10);
            }
            //Get all pending requests
            $pending_requests = 0;
            $rlf = new RequestListFactory();
            $rlf->getSumByPayPeriodIdAndStatus($pay_period_obj->getId(), 30);
            if ($rlf->getRecordCount() > 0) {
                $pending_requests = $rlf->getCurrent()->getColumn('total');
            }
            $pay_period_data['pending_requests'] = $pending_requests;
            //Count how many punches are in this pay period.
            $plf = new PunchListFactory();
            $pay_period_data['total_punches'] = $plf->getByPayPeriodId($pay_period_id)->getRecordCount();
            Debug::Text(' Total Punches: ' . $pay_period_data['total_punches'], __FILE__, __LINE__, __METHOD__, 10);
        }
        //var_dump($pay_period_data);
        $smarty->assign_by_ref('exceptions', $exceptions);
        $smarty->assign_by_ref('pay_period_data', $pay_period_data);
        $smarty->assign_by_ref('current_epoch', TTDate::getTime());
        break;
}