/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PLANECHECKINGBILL' AND KSQL_COL_NAME IN ('FISDEDUCTIBLE')) 
 ALTER TABLE T_ER_PLANECHECKINGBILL ADD (FISDEDUCTIBLE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_ALLCHECKINGBILL' AND KSQL_COL_NAME IN ('FISDEDUCTIBLE')) 
 ALTER TABLE T_ER_ALLCHECKINGBILL ADD (FISDEDUCTIBLE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PLANEBILL' AND KSQL_COL_NAME IN ('FISDEDUCTIBLE')) 
 ALTER TABLE T_ER_PLANEBILL ADD (FISDEDUCTIBLE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_ALLORDERBILL' AND KSQL_COL_NAME IN ('FISDEDUCTIBLE')) 
 ALTER TABLE T_ER_ALLORDERBILL ADD (FISDEDUCTIBLE CHAR(1) DEFAULT '0' NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PLANECHECKINGBILL' AND KSQL_COL_NAME IN ('FITINERARYNUM')) 
 ALTER TABLE T_ER_PLANECHECKINGBILL ADD (FITINERARYNUM VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PLANECHECKINGBILL' AND KSQL_COL_NAME IN ('FITINERARYDATE')) 
 ALTER TABLE T_ER_PLANECHECKINGBILL ADD (FITINERARYDATE DATETIME );
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql **/
