-- 
-- MosP - Mind Open Source Project    http://www.mosp.jp/
-- Copyright (C) MIND Co., Ltd.       http://www.e-mind.co.jp/
-- 
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; either version 2
-- of the License, or (at your option) any later version.
-- 
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
-- 
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-- 
ALTER TABLE `PM_ATTENDANCE` ADD `JCODE` VARCHAR(4) NOT NULL COMMENT '事業所コード' AFTER `RTCODE`;

ALTER TABLE `M_SYUKKINBO` 
ADD `WARIMASI1` INT NOT NULL DEFAULT '0' COMMENT '1.00割増' AFTER `NIJIKYU`,
ADD `ZKINMU` VARCHAR(10) NOT NULL DEFAULT '' COMMENT '前回勤務形態' AFTER `WARIMASI1`;

ALTER TABLE `M_SCHEDULE` 
ADD `WARIMASI1` INT NOT NULL DEFAULT '0' COMMENT '1.00割増' AFTER `NIJIKYU`,
ADD `ZKINMU` VARCHAR(10) NOT NULL DEFAULT '' COMMENT '前回勤務形態' AFTER `WARIMASI1`;

ALTER TABLE `M_KINTAI` ADD `WARIMASI1` INT NOT NULL DEFAULT '0' COMMENT '1.00割増' AFTER `NIJIKYU`;

DROP TABLE IF EXISTS `CT_OVERTIME_REQUEST`;
CREATE TABLE `CT_OVERTIME_REQUEST` (
  VOUCHER int(10) unsigned zerofill NOT NULL COMMENT '残業申請伝票番号',
  WORKFLOW bigint(20) unsigned zerofill NOT NULL COMMENT 'ワークフロー番号',
  KCODE varchar(10) NOT NULL COMMENT '社員コード',
  REQUESTDATE date NOT NULL COMMENT '申請日',
  WORKDATE date NOT NULL COMMENT '勤務日',
  OVERTIME int(11) NOT NULL COMMENT '申請時間',
  REASON text NOT NULL COMMENT '事由',
  DELETEFLAG int(1) NOT NULL COMMENT '削除フラグ',
  ADDDT datetime NOT NULL COMMENT '登録日',
  ADDCD varchar(10) NOT NULL COMMENT '登録者',
  UPDDT timestamp NOT NULL default CURRENT_TIMESTAMP COMMENT '更新日',
  UPDCD varchar(10) NOT NULL COMMENT '更新者',
  PRIMARY KEY  (VOUCHER)
) ENGINE=InnoDB DEFAULT CHARSET=cp932 COMMENT='残業申請テーブル';
