-- 
-- 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.
-- 
--
-- Table structure for table `CT_RETIRE_DETAIL`
--
DROP TABLE IF EXISTS `CT_RETIRE_DETAIL`;
CREATE TABLE `CT_RETIRE_DETAIL` (
  `CITY_CODE` varchar(6) NOT NULL default '' COMMENT '市町村コード',
  `DETAIL_MONTH` date NOT NULL default '1901-01-01' COMMENT '退職明細年月',
  `CITY_CHANGES` varchar(2) NOT NULL default '' COMMENT '異動有無',
  `RETIRE_COUNT` int(3) NOT NULL default '0' COMMENT '退職人員',
  `CITY_PAY_AMOUNT` bigint(10) NOT NULL default '0' COMMENT '支払金額',
  `CITY_TAX` int(9) NOT NULL default '0' COMMENT '市町村税',
  `PREFECTURE_TAX` int(9) NOT NULL default '0' COMMENT '道府県税',
  `INSERT_DATE` timestamp NOT NULL default '1970-12-31 06:00:00' COMMENT '作成日',
  `INSERT_USER` varchar(10) NOT NULL default '' COMMENT '作成者',
  `UPDATE_DATE` timestamp NOT NULL default '1970-12-31 06:00:00' COMMENT '更新日',
  `UPDATE_USER` varchar(10) NOT NULL default '' COMMENT '更新者',
  PRIMARY KEY  (`CITY_CODE`,`DETAIL_MONTH`)
) ENGINE=InnoDB DEFAULT CHARSET=cp932 COMMENT='退職明細情報';

--
-- Table structure for table `CD_ADJUSTMENT`
--
DROP TABLE IF EXISTS `CD_ADJUSTMENT`;
CREATE TABLE `CD_ADJUSTMENT` (
  `K_CODE` varchar(10) NOT NULL default '' COMMENT '社員コード',
  `ADJUST_YEAR` int(4) NOT NULL default '0' COMMENT '調整年',
  `ADJUST_STATUS` varchar(2) NOT NULL default '' COMMENT '年末調整計算状態',
  `GENERAL_LIFE_INS` int(8) NOT NULL default '0' COMMENT '一般の生命保険料',
  `PRIVATE_PENSION` int(8) NOT NULL default '0' COMMENT '個人年金保険料',
  `LIFE_INS_DEDUCTION` int(8) NOT NULL default '0' COMMENT '生命保険料控除額',
  `EARTHQUAKE_INS` int(8) NOT NULL default '0' COMMENT '地震保険料',
  `LONG_TERM_DAMAGE_INS` int(8) NOT NULL default '0' COMMENT '旧長期損害保険料',
  `DAMAGE_INS_DEDUCTION` int(8) NOT NULL default '0' COMMENT '損害保険料控除額',
  `SOCIAL_INS_DEDUCTION` int(8) NOT NULL default '0' COMMENT '社会保険料控除額',
  `MUTUAL_AID_DEDUCTION` int(8) NOT NULL default '0' COMMENT '小規模企業共済等掛金控除額',
  `SPOUSE_SUM_INCOME` int(8) NOT NULL default '0' COMMENT '配偶者の本年中の合計所得金額の見積額',
  `SPOUSE_SP_DEDUCTION` int(8) NOT NULL default '0' COMMENT '配偶者特別控除額',
  `HOUSE_LOAN_DEDUCTION` int(8) NOT NULL default '0' COMMENT '住宅借入金等特別控除額',
  `ALLOWANCE_ADJUSTMENT` int(8) NOT NULL default '0' COMMENT '支給調整額',
  `TAX_FREE_ADJUSTMENT` int(8) NOT NULL default '0' COMMENT '非課税調整額',
  `SOC_INS_ADJUSTMENT` int(8) NOT NULL default '0' COMMENT '社会保険調整額',
  `TAX_INC_ADJUSTMENT` int(8) NOT NULL default '0' COMMENT '所得税調整額',
  `PAYMENT_ALLOWANCE` int(8) NOT NULL default '0' COMMENT '給与、手当等金額',
  `PAYMENT_INCOME_TAX` int(8) NOT NULL default '0' COMMENT '給与、手当等税額',
  `BONUS_ALLOWANCE` int(8) NOT NULL default '0' COMMENT '賞与等金額',
  `BONUS_INCOME_TAX` int(8) NOT NULL default '0' COMMENT '賞与等税額',
  `MIDWAY_ADJUST_INCOME` int(8) NOT NULL default '0' COMMENT '中途、調整収入金額',
  `MIDWAY_ADJUST_TAX` int(8) NOT NULL default '0' COMMENT '中途、調整収入税額',
  `AFTER_DEDUCT_INCOME` int(8) NOT NULL default '0' COMMENT '給与所得控除後の給与等の金額',
  `PAY_INS_DEDUCTION` int(8) NOT NULL default '0' COMMENT '社会保険料等給与等からの控除分',
  `DEPENDENTS_DEDUCTION` int(8) NOT NULL default '0' COMMENT '配偶者控除額、扶養控除額、基礎控除額及び障害者等の控除額の合計額',
  `CALC_TAXED_INCOME` int(8) NOT NULL default '0' COMMENT '差引課税給与所得金額',
  `CALC_INCOME_TAX` int(8) NOT NULL default '0' COMMENT '算出年税額',
  `ADJUSTED_INCOME_TAX` int(8) NOT NULL default '0' COMMENT '年調年税額',
  `DEDUCTED_INCOME_TAX` int(8) NOT NULL default '0' COMMENT '年調定率控除額税額',
  `FINAL_INCOME_TAX` int(8) NOT NULL default '0' COMMENT '年税額',
  `WITHHOLD_SLIP_NOTES` varchar(255) NOT NULL default '' COMMENT '源泉徴収票摘要欄',
  `DEAD_RETIREMENT` varchar(2) NOT NULL default '' COMMENT '死亡退職',
  `SELF_DISASTER` varchar(2) NOT NULL default '' COMMENT '災害者',
  `FOREIGNER` varchar(2) NOT NULL default '' COMMENT '外国人',
  `INSERT_DATE` timestamp NOT NULL default '1970-12-31 06:00:00' COMMENT '作成日',
  `INSERT_USER` varchar(10) NOT NULL default '' COMMENT '作成者',
  `UPDATE_DATE` timestamp NOT NULL default '1970-12-31 06:00:00' COMMENT '更新日',
  `UPDATE_USER` varchar(10) NOT NULL default '' COMMENT '更新者',
  PRIMARY KEY  (`K_CODE`,`ADJUST_YEAR`)
) ENGINE=InnoDB DEFAULT CHARSET=cp932 COMMENT='年末調整データ';

--
-- Table structure for table `CM_MIDWAY_ENTER`
--
DROP TABLE IF EXISTS `CM_MIDWAY_ENTER`;
CREATE TABLE `CM_MIDWAY_ENTER` (
  `K_CODE` varchar(10) NOT NULL default '' COMMENT '社員コード',
  `MIDWAY_TYPE` varchar(8) NOT NULL default '' COMMENT '中途入社区分',
  `FORMER_INCOME` int(8) NOT NULL default '0' COMMENT '前勤務先収入金額',
  `FORMER_INSURANCE` int(8) NOT NULL default '0' COMMENT '前勤務先社会保険額',
  `FORMER_TAX` int(8) NOT NULL default '0' COMMENT '前勤務先所得税額',
  `INSERT_DATE` timestamp NOT NULL default '1970-12-31 15:00:00' COMMENT '作成日',
  `INSERT_USER` varchar(10) NOT NULL default '' COMMENT '作成者',
  `UPDATE_DATE` timestamp NOT NULL default '1970-12-31 15:00:00' COMMENT '更新日',
  `UPDATE_USER` varchar(10) NOT NULL default '' COMMENT '更新者',
  PRIMARY KEY  (`K_CODE`)
) ENGINE=InnoDB DEFAULT CHARSET=cp932 COMMENT='人事マスタ中途入社部';


--
-- Table structure for table `CD_SOC_INSURANCE`
--
DROP TABLE IF EXISTS `CD_SOC_INSURANCE`;
CREATE TABLE `CD_SOC_INSURANCE` (
  `K_CODE` varchar(10) NOT NULL default '' COMMENT '社員コード',
  `K_NAME` varchar(16) NOT NULL default '' COMMENT '社員氏名',
  `SCODE` varchar(6) NOT NULL default '' COMMENT '所属コード',
  `CALC_DATE` date NOT NULL default '1901-01-01' COMMENT '計算年月',
  `PAY_BASIC_MONTH1` int(2) NOT NULL default '0' COMMENT '支払基礎日数1(月)',
  `PAY_BASIC_MONTH2` int(2) NOT NULL default '0' COMMENT '支払基礎日数2(月)',
  `PAY_BASIC_MONTH3` int(2) NOT NULL default '0' COMMENT '支払基礎日数3(月)',
  `PAY_BASIC_DAY1` int(2) NOT NULL default '0' COMMENT '支払基礎日数1(日)',
  `PAY_BASIC_DAY2` int(2) NOT NULL default '0' COMMENT '支払基礎日数2(日)',
  `PAY_BASIC_DAY3` int(2) NOT NULL default '0' COMMENT '支払基礎日数3(日)',
  `PAY_AMOUNT1` int(8) NOT NULL default '0' COMMENT '金銭の額1',
  `PAY_AMOUNT2` int(8) NOT NULL default '0' COMMENT '金銭の額2',
  `PAY_AMOUNT3` int(8) NOT NULL default '0' COMMENT '金銭の額3',
  `GOODS_AMOUNT1` int(8) NOT NULL default '0' COMMENT '現物の額1',
  `GOODS_AMOUNT2` int(8) NOT NULL default '0' COMMENT '現物の額2',
  `GOODS_AMOUNT3` int(8) NOT NULL default '0' COMMENT '現物の額3',
  `REWARD_TOTAL1` int(8) NOT NULL default '0' COMMENT '報酬合計1',
  `REWARD_TOTAL2` int(8) NOT NULL default '0' COMMENT '報酬合計2',
  `REWARD_TOTAL3` int(8) NOT NULL default '0' COMMENT '報酬合計3',
  `REWARD_TOTAL_SUM` int(8) NOT NULL default '0' COMMENT '報酬総額',
  `AVERAGE_THREE_MONTHS` int(8) NOT NULL default '0' COMMENT '３ヶ月平均',
  `EDIT_AVERAGE` int(8) NOT NULL default '0' COMMENT '修正平均',
  `HEALTH_BEF_GRADE` int(2) NOT NULL default '0' COMMENT '健保従前等級',
  `HEALTH_BEF_PREMIUM` int(8) NOT NULL default '0' COMMENT '健保従前保険料',
  `PENSION_BEF_GRADE` int(2) NOT NULL default '0' COMMENT '厚年従前等級',
  `PENSION_BEF_PREMIUM` int(8) NOT NULL default '0' COMMENT '厚年従前保険料',
  `HEALTH_DEC_GRADE` int(2) NOT NULL default '0' COMMENT '健保決定等級',
  `HEALTH_DEC_PREMIUM` int(8) NOT NULL default '0' COMMENT '健保決定保険料',
  `PENSION_DEC_GRADE` int(2) NOT NULL default '0' COMMENT '厚年決定等級',
  `PENSION_DEC_PREMIUM` int(8) NOT NULL default '0' COMMENT '厚年決定保険料',
  `RETROACTIVE_PAYMENT` int(8) NOT NULL default '0' COMMENT '遡及支払額',
  `RAISE_DOWN_SALARY_DATE` date NOT NULL default '1901-01-01' COMMENT '昇降給年月',
  `RAISE_DOWN_SALARY_BASIS` int(8) NOT NULL default '0' COMMENT '昇降給差の月額',
  `EXPECTED_DATE` date NOT NULL default '1901-01-01' COMMENT '適用年月',
  `CALC_RESULT` varchar(10) NOT NULL default '' COMMENT '計算結果',
  `INSERT_DATE` timestamp NOT NULL default '1970-12-30 21:00:00' COMMENT '作成日',
  `INSERT_USER` varchar(10) NOT NULL default '' COMMENT '作成者',
  `UPDATE_DATE` timestamp NOT NULL default '1970-12-30 21:00:00' COMMENT '更新日',
  `UPDATE_USER` varchar(10) NOT NULL default '' COMMENT '更新者',
  PRIMARY KEY  (`K_CODE`,`CALC_DATE`)
) ENGINE=InnoDB DEFAULT CHARSET=cp932 COMMENT='社会保険計算データ';

