/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCCIT_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_TAX_ACCE_DIFF' AND KSQL_COL_NAME ='FCURRENTTAXDIFF') 
 ALTER TABLE T_TCCIT_TAX_ACCE_DIFF ADD (FCURRENTTAXDIFF DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_TAX_ACCE_DIFF' AND KSQL_COL_NAME ='FYEARTAXDIFF') 
 ALTER TABLE T_TCCIT_TAX_ACCE_DIFF ADD (FYEARTAXDIFF DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_TAX_ACCE_DIFF' AND KSQL_COL_NAME ='FTOTALTAXDIFF') 
 ALTER TABLE T_TCCIT_TAX_ACCE_DIFF ADD (FTOTALTAXDIFF DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_TAX_ACCE_DIFF' AND KSQL_COL_NAME ='FDECLARETHISPERIOD') 
 ALTER TABLE T_TCCIT_TAX_ACCE_DIFF ADD (FDECLARETHISPERIOD CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_TAX_ACCE_DIFF' AND KSQL_COL_NAME ='FDECLAREPERIOD') 
 ALTER TABLE T_TCCIT_TAX_ACCE_DIFF ADD (FDECLAREPERIOD DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_THINKOFSELL_DET') 
 CREATE TABLE T_TCCIT_THINKOFSELL_DET (
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(30) DEFAULT ' ' NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDATADIRECTION VARCHAR(30) 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
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_THINKOFSELL_SUM') 
 CREATE TABLE T_TCCIT_THINKOFSELL_SUM (
FID BIGINT DEFAULT 0 NOT NULL,
FITEMNO BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FPRODUCTTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCOST DECIMAL(23,10) DEFAULT 0 NOT NULL,
FADJUSTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRULEID BIGINT DEFAULT 0 NOT NULL,
FITEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_YEAR_RULE' AND KSQL_COL_NAME ='FSPAP') 
 ALTER TABLE T_TCCIT_YEAR_RULE ADD (FSPAP VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_SAME_SOLD_ACCOUNT') 
 CREATE TABLE T_TCCIT_SAME_SOLD_ACCOUNT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSAMESOLDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATE DATETIME,
FDESCRIBE VARCHAR(250) DEFAULT ' ' NOT NULL,
FREMARKS VARCHAR(250) DEFAULT ' ' NOT NULL,
FSELFORHE VARCHAR(50) DEFAULT ' ' NOT NULL,
FINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCOST DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_SALARY_ACCOUNT') 
 CREATE TABLE T_TCCIT_SALARY_ACCOUNT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORG BIGINT DEFAULT 0 NOT NULL,
FPROJECTORPART VARCHAR(50) DEFAULT ' ' NOT NULL,
FACCOUNTYEAR DATETIME,
FACTUALPAY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLASTYEARPAY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FGIVEMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FACTUALPAYNOTAX DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREMARKS VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_INTERTE_DEDUCT') 
 CREATE TABLE T_TCCIT_INTERTE_DEDUCT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORG BIGINT DEFAULT 0 NOT NULL,
FTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROJECTNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FCONTRACTNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOSTCENTER VARCHAR(50) DEFAULT ' ' NOT NULL,
FDOCNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FACCOUNTDATE DATETIME,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROVISIONMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FACTUALPAY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREMARKS VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_TAX_EQUITY_INCENT') 
 CREATE TABLE T_TCCIT_TAX_EQUITY_INCENT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FINCENTIVETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FBOOKDATE DATETIME,
FTAXPERIOD DATETIME,
FINCENTIVESTATE VARCHAR(50) DEFAULT ' ' NOT NULL,
FTCOUNT BIGINT DEFAULT 0 NOT NULL,
FGPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPRICESUM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FOUTMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNOMONEY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREMARK VARCHAR(50) DEFAULT ' ' NOT NULL
);



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