/**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_SALE_FINISH_E') 
 CREATE TABLE T_TCCIT_SALE_FINISH_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FSALEFINISHINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFINISHRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFINISHPROFIT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFINISHNSTZ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFINISHPERIODSTART DATETIME,
FFINISHPERIODEND DATETIME,
FZHSJFSDTAXINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_SALE_NO_FINISH_E') 
 CREATE TABLE T_TCCIT_SALE_NO_FINISH_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FSALENOFINISHINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNOFINISHRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNOFINISHPROFIT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSJFSDTAXINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNOFINISHNSTZ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNOFINISHPERIODSTART DATETIME,
FNOFINISHPERIODEND DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_SPEC_BUS_NSTZ') 
 CREATE TABLE T_TCCIT_SPEC_BUS_NSTZ (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERIOD DATETIME,
FSALENOFINISHNSTZ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSALEFINISHNSTZ DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSPECBUSREALDEVNSTZ DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCCIT_SPEC_BUS_REAL_DEV') 
 CREATE TABLE T_TCCIT_SPEC_BUS_REAL_DEV (
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,
FITEMNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FITEMNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FSBTYPE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_DG_B105093MLE_SUM' AND KSQL_COL_NAME ='FFETCHOK') 
 ALTER TABLE T_TCCIT_DG_B105093MLE_SUM ADD (FFETCHOK CHAR(1) DEFAULT '0' NOT NULL );

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