/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\TCTB_table.sql **/
 EXEC p_AlterColumn 'T_TCTB_TAX_MAIN', 'FISENTITY', 'CHAR(1)', 'NOT NULL', '0001', '''0''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_NEW_TJSJB' AND KSQL_COL_NAME ='FTAXOFFICE') 
 ALTER TABLE T_TCTB_NEW_TJSJB ADD (FTAXOFFICE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_NEW_TJSJB' AND KSQL_COL_NAME ='FSJSJ') 
 ALTER TABLE T_TCTB_NEW_TJSJB ADD (FSJSJ DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_NEW_TJSJB' AND KSQL_COL_NAME ='FJKDATE') 
 ALTER TABLE T_TCTB_NEW_TJSJB ADD (FJKDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_NEW_TJSJB' AND KSQL_COL_NAME ='FTAXATIONSYS') 
 ALTER TABLE T_TCTB_NEW_TJSJB ADD (FTAXATIONSYS BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TCTB_NEW_TJSJB' AND KSQL_COL_NAME ='FTAXAREAGROUP') 
 ALTER TABLE T_TCTB_NEW_TJSJB ADD (FTAXAREAGROUP BIGINT DEFAULT 0 NOT NULL );

--税金计提单增加税收辖区 黄友明
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ITP_PROVISTON_TAXES' AND KSQL_COL_NAME ='FTAXAREA')
ALTER TABLE T_ITP_PROVISTON_TAXES ADD (FTAXAREA BIGINT DEFAULT 0 NOT NULL );

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