/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_PERIOD_SUMMARY') 
 CREATE TABLE T_TCCIT_PERIOD_SUMMARY (
FID BIGINT DEFAULT 0 NOT NULL,
FITEMNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FADJUSTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FZZJEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPAYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FITEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_SALARY_SUMMARY') 
 CREATE TABLE T_TCCIT_SALARY_SUMMARY (
FID BIGINT DEFAULT 0 NOT NULL,
FITEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSALARY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSTOCK DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINSURANCE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCOMMRESERVE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSUMAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FITEMNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_DEDUCT_TZ_DETAIL' AND KSQL_COL_NAME ='FABSOLUTE') 
 ALTER TABLE T_TCCIT_DEDUCT_TZ_DETAIL ADD (FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_THINKOFSELL_DET' AND KSQL_COL_NAME ='FABSOLUTE') 
 ALTER TABLE T_TCCIT_THINKOFSELL_DET ADD (FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_BEFORETAX_DETAIL') 
 CREATE TABLE T_TCCIT_BEFORETAX_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FTAXACCOUNTSERIALNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FSUBJECTID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTABLE BIGINT DEFAULT 0 NOT NULL,
FAMOUNTFIELD BIGINT DEFAULT 0 NOT NULL,
FTABLETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(50) DEFAULT ' ' NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFETCHAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFILTERCONDITION VARCHAR(2000) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FENTRYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_PERIOD_TZ_DETAIL') 
 CREATE TABLE T_TCCIT_PERIOD_TZ_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FTAXACCOUNTSERIALNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FSUBJECTID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTABLE BIGINT DEFAULT 0 NOT NULL,
FAMOUNTFIELD BIGINT DEFAULT 0 NOT NULL,
FTABLETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(50) DEFAULT ' ' NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFETCHAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFILTERCONDITION VARCHAR(2000) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FITEMNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTRYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_SALARY_TZ_DETAIL') 
 CREATE TABLE T_TCCIT_SALARY_TZ_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FTAXACCOUNTSERIALNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSUBJECTID VARCHAR(36) DEFAULT ' ' NOT NULL,
FTABLE BIGINT DEFAULT 0 NOT NULL,
FAMOUNTFIELD BIGINT DEFAULT 0 NOT NULL,
FTABLETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(50) DEFAULT ' ' NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFETCHAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFILTERCONDITION VARCHAR(2000) DEFAULT ' ' NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FENTRYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FABSOLUTE CHAR(1) DEFAULT ' ' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_table.sql **/
