/**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_INCRED_ACCDETAIL') 
 CREATE TABLE T_TCCIT_INCRED_ACCDETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FTAXACCOUNTSERIALNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FTABLETYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(30) DEFAULT ' ' NOT NULL,
FFETCHAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFILTERCONDITION VARCHAR(510) DEFAULT ' ' NOT NULL,
FSUBJECTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_INCRED_SUMMARY') 
 CREATE TABLE T_TCCIT_INCRED_SUMMARY (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FINCREDTOTAL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINCREDTYPE BIGINT DEFAULT 0 NOT NULL,
FSERIALNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FINCREDINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINCREDPRESENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FDISCOUNTTYPE VARCHAR(30) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_NONTAX_ACCDETAIL') 
 CREATE TABLE T_TCCIT_NONTAX_ACCDETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FTAXACCOUNTSERIALNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FTABLETYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(30) DEFAULT ' ' NOT NULL,
FFETCHAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFILTERCONDITION VARCHAR(510) DEFAULT ' ' NOT NULL,
FSUBJECTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_TREDUCE_ACCDETAIL') 
 CREATE TABLE T_TCCIT_TREDUCE_ACCDETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FTAXACCOUNTSERIALNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FTABLETYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(30) DEFAULT ' ' NOT NULL,
FFETCHAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFILTERCONDITION VARCHAR(510) DEFAULT ' ' NOT NULL,
FSUBJECTID VARCHAR(100) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_NONTAX_SUMMARY') 
 CREATE TABLE T_TCCIT_NONTAX_SUMMARY (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNONTAXTOTAL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNONTAXPRESENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSERIALNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FNONTAXINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FDISCOUNTTYPE BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_TREDUCED_SUMMARY') 
 CREATE TABLE T_TCCIT_TREDUCED_SUMMARY (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FTREDUCEDPRESENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTREDUCEDTOTAL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSERIALNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FTREDUCEDINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTREDUCEDPERCENT BIGINT DEFAULT 0 NOT NULL,
FDISCOUNTTYPE BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FRULEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_TAXPAY_SUMMARY') 
 CREATE TABLE T_TCCIT_TAXPAY_SUMMARY (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FBQS1 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBQS2 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBQS3 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBQS4 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJS1 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJS2 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJS3 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLJS4 DECIMAL(23,10) DEFAULT 0 NOT NULL
);



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