/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_INITBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTSCHEME' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_INVCOUNTSCHEME ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_INVCOUNTBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_TRANSDIRBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_OTHEROUTBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHERINBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_OTHERINBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_TRANSOUTBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_TRANSINBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSAPPLY' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_TRANSAPPLY ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_MREQBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_PRODUCTINBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ADJUSTBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_ADJUSTBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_PURINBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_PURRECBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MREQOUTBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_MREQOUTBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_ASSEMBBILL' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_ASSEMBBILL ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_LOCATIONTRANSFER' AND KSQL_COL_NAME ='FBILLCRETYPE') 
 ALTER TABLE T_IM_LOCATIONTRANSFER ADD (FBILLCRETYPE CHAR(1) DEFAULT '0' NOT NULL );

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