$data['trigger_time'] = TTDate::parseTimeUnit($data['trigger_time']);
}
$otpf = new OverTimePolicyFactory();
$action = Misc::findSubmitButton();
$action = strtolower($action);
switch ($action) {
    case 'submit':
        Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10);
        $otpf->setId($data['id']);
        $otpf->setCompany($current_company->getId());
        $otpf->setName($data['name']);
        $otpf->setType($data['type_id']);
        //$otpf->setLevel( $data['level'] );
        $otpf->setTriggerTime($data['trigger_time']);
        $otpf->setRate($data['rate']);
        $otpf->setWageGroup($data['wage_group_id']);
        $otpf->setAccrualPolicyId($data['accrual_policy_id']);
        $otpf->setAccrualRate($data['accrual_rate']);
        $otpf->setPayStubEntryAccountId($data['pay_stub_entry_account_id']);
        if ($otpf->isValid()) {
            $otpf->Save();
            Redirect::Page(URLBuilder::getURL(NULL, 'OverTimePolicyList.php'));
            break;
        }
    default:
        if (isset($id)) {
            BreadCrumb::setCrumb($title);
            $otplf = new OverTimePolicyListFactory();
            $otplf->getByIdAndCompanyID($id, $current_company->getID());
            foreach ($otplf as $otp_obj) {
                //Debug::Arr($station,'Department', __FILE__, __LINE__, __METHOD__,10);