/**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_APPORTION_SUMMARY') 
 CREATE TABLE T_TCCIT_APPORTION_SUMMARY (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSKSSQQ DATETIME,
FSKSSQZ DATETIME,
FINCOME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEMOLUMENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTOTALASSETS DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTAXORGID BIGINT DEFAULT 0 NOT NULL,
FTAXORGNAME VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_SEASONAL_POLICY' AND KSQL_COL_NAME ='FYEAR') 
 ALTER TABLE T_TCCIT_SEASONAL_POLICY ADD (FYEAR VARCHAR(30) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_SEASONAL_POLICY' AND KSQL_COL_NAME ='FJIDU') 
 ALTER TABLE T_TCCIT_SEASONAL_POLICY ADD (FJIDU VARCHAR(30) DEFAULT ' ' );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_INCRED_SUMMARY' AND KSQL_COL_NAME ='FTAXORGID') 
 ALTER TABLE T_TCCIT_INCRED_SUMMARY ADD (FTAXORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_NONTAX_SUMMARY' AND KSQL_COL_NAME ='FTAXORGID') 
 ALTER TABLE T_TCCIT_NONTAX_SUMMARY ADD (FTAXORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCCIT_TREDUCED_SUMMARY' AND KSQL_COL_NAME ='FTAXORGID') 
 ALTER TABLE T_TCCIT_TREDUCED_SUMMARY ADD (FTAXORGID BIGINT DEFAULT 0 NOT NULL );

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