Beispiel #1
0
                $last_date = $punch_obj->getPunchControlObject()->getUserDateObject()->getDateStamp();
            } else {
                $last_date = TTDate::getTime();
            }
            Debug::Text('Last Punch Date: ' . TTDate::getDate('DATE+TIME', $last_date), __FILE__, __LINE__, __METHOD__, 10);
            //Get pay period of last shift workd
            $plf = new PayPeriodListFactory();
            $pay_period_obj = $plf->getByUserIdAndEndDate($user_id, $last_date)->getCurrent();
            $pay_period_type_id = FALSE;
            if (is_object($pay_period_obj->getPayPeriodScheduleObject())) {
                $pay_period_type_id = $pay_period_obj->getPayPeriodScheduleObject()->getType();
            }
            $roe_data = array('user_id' => $user_id, 'pay_period_type_id' => $pay_period_type_id, 'first_date' => $first_date, 'last_date' => $last_date, 'pay_period_end_date' => $pay_period_obj->getEndDate());
        }
        //Select box options;
        $roe_data['code_options'] = $roef->getOptions('code');
        $ppsf = new PayPeriodScheduleFactory();
        $roe_data['pay_period_type_options'] = $ppsf->getOptions('type');
        unset($roe_data['pay_period_type_options'][5]);
        $user_options = UserListFactory::getByCompanyIdArray($current_company->getId(), FALSE);
        $smarty->assign_by_ref('user_options', $user_options);
        //PSEA accounts
        $psealf = new PayStubEntryAccountListFactory();
        $earning_pay_stub_entry_account_options = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(10, 30, 40), TRUE);
        $smarty->assign_by_ref('earning_pay_stub_entry_account_options', $earning_pay_stub_entry_account_options);
        $smarty->assign_by_ref('roe_data', $roe_data);
        $smarty->assign_by_ref('setup_data', $setup_data);
        break;
}
$smarty->assign_by_ref('roef', $roef);
$smarty->display('roe/EditROE.tpl');