/**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_INITBILLENTRY_X' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_INITBILLENTRY_X ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY_X' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_TRANSINBILLENTRY_X ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL_C' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_SALOUTBILL_C ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL_S' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_PURINBILL_S ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY_F' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY_F ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PRODUCTINBILLENTRY_X' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_PRODUCTINBILLENTRY_X ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL_S' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_PURRECBILL_S ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY_F' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_PURINBILLENTRY_F ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY_F' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_PURRECBILLENTRY_F ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY_F' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_SALOUTBILLENTRY_F ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY_X' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY_X ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY_X' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY_X ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY_X' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY_X ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY_D' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_PURRECBILLENTRY_D ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL_F' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_PURINBILL_F ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL_F' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_SALOUTBILL_F ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL_F' AND KSQL_COL_NAME ='FTRANFLAG') 
 ALTER TABLE T_IM_PURRECBILL_F ADD (FTRANFLAG CHAR(1) DEFAULT '0' NOT NULL );*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYSTARTQTY') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYSTARTQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYSTARTQTYUNIT2ND') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYSTARTQTYUNIT2ND DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYSTARTQTYUNIT3RD') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYSTARTQTYUNIT3RD DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYSTARTBASEQTY') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYSTARTBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYRECEIVEQTY') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYRECEIVEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYRECEIVEQTYUNIT2ND') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYRECEIVEQTYUNIT2ND DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYRECEIVEQTYUNIT3RD') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYRECEIVEQTYUNIT3RD DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYRECEIVEBASEQTY') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYRECEIVEBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYSENDQTY') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYSENDQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYSENDQTYUNIT2ND') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYSENDQTYUNIT2ND DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYSENDQTYUNIT3RD') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYSENDQTYUNIT3RD DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INITBILLENTRY' AND KSQL_COL_NAME ='FYSENDBASEQTY') 
 ALTER TABLE T_IM_INITBILLENTRY ADD (FYSENDBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FPROJECTID') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FPROJECTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FENTRYCOMMENT') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FENTRYCOMMENT VARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FSOURCEFLAG') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FSOURCEFLAG VARCHAR(5) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FINVACCID') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FINVACCID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FSERIALUNITID') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FSERIALUNITID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FSERIALLOSSQTY') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FSERIALLOSSQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FSERIALUNITRATE') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FSERIALUNITRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FSERIALGAINQTY') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FSERIALGAINQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FSRCBILLENTITY') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FSRCBILLENTITY NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FSRCBILLID') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FSRCBILLID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FSRCBILLENTRYID') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FSRCBILLENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FMVERSION') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FMVERSION BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FCHECKQTY') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FCHECKQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FCHECKBASEQTY') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FCHECKBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FCHECKQTYUNIT2ND') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FCHECKQTYUNIT2ND DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FADJUSTQTY') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FADJUSTQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FADJUSTBASEQTY') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FADJUSTBASEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_INVCOUNTBILLENTRY' AND KSQL_COL_NAME ='FADJUSTQTYUNIT2ND') 
 ALTER TABLE T_IM_INVCOUNTBILLENTRY ADD (FADJUSTQTYUNIT2ND DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME ='FPRICE') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OTHEROUTBILLENTRY' AND KSQL_COL_NAME ='FAMOUNT') 
 ALTER TABLE T_IM_OTHEROUTBILLENTRY ADD (FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FPAYCONDITIONID') 
 ALTER TABLE T_IM_PURINBILL ADD (FPAYCONDITIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FSETTLETYPEID') 
 ALTER TABLE T_IM_PURINBILL ADD (FSETTLETYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FSETTLECURRENCYID') 
 ALTER TABLE T_IM_PURINBILL ADD (FSETTLECURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FCURRENCYID') 
 ALTER TABLE T_IM_PURINBILL ADD (FCURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FISTAX') 
 ALTER TABLE T_IM_PURINBILL ADD (FISTAX CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FEXRATETABLEID') 
 ALTER TABLE T_IM_PURINBILL ADD (FEXRATETABLEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FEXCHANGERATE') 
 ALTER TABLE T_IM_PURINBILL ADD (FEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FEXRATETABLE') 
 ALTER TABLE T_IM_PURINBILL ADD (FEXRATETABLE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_IM_PURINBILL ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FPAYMODE') 
 ALTER TABLE T_IM_PURINBILL ADD (FPAYMODE NVARCHAR(30) DEFAULT 'CREDIT' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILL' AND KSQL_COL_NAME ='FSUPPLIERID') 
 ALTER TABLE T_IM_PURINBILL ADD (FSUPPLIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FPRICE') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FPRICEANDTAX') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FPRICEANDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FTAXRATE') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FTAXRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FTAXAMOUNT') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FCURTAXAMOUNT') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FCURTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FDISCOUNTTYPE') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FDISCOUNTTYPE VARCHAR(5) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FDISCOUNTRATE') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FDISCOUNTRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FDISCOUNTAMOUNT') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FDISCOUNTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FAMOUNT') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FCURAMOUNT') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FCURAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FAMOUNTANDTAX') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FAMOUNTANDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FCURAMOUNTANDTAX') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FCURAMOUNTANDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FENTRYSETTLEORGID') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FENTRYSETTLEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FTAXRATEID') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FTAXRATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FACTUALPRICE') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FACTUALPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FACTUALTAXPRICE') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FACTUALTAXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FCURRENCYID') 
 ALTER TABLE T_IM_PURRECBILL ADD (FCURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FSETTLECURRENCYID') 
 ALTER TABLE T_IM_PURRECBILL ADD (FSETTLECURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FEXCHANGERATE') 
 ALTER TABLE T_IM_PURRECBILL ADD (FEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FPAYCONDITIONID') 
 ALTER TABLE T_IM_PURRECBILL ADD (FPAYCONDITIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FSETTLETYPEID') 
 ALTER TABLE T_IM_PURRECBILL ADD (FSETTLETYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FISTAX') 
 ALTER TABLE T_IM_PURRECBILL ADD (FISTAX CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FEXRATETABLE') 
 ALTER TABLE T_IM_PURRECBILL ADD (FEXRATETABLE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_IM_PURRECBILL ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FPAYMODE') 
 ALTER TABLE T_IM_PURRECBILL ADD (FPAYMODE NVARCHAR(30) DEFAULT 'CREDIT' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILL' AND KSQL_COL_NAME ='FSUPPLIERID') 
 ALTER TABLE T_IM_PURRECBILL ADD (FSUPPLIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FENTRYREQORGID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FENTRYREQORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FINVSTATUSID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FINVSTATUSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FLOCATIONID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FLOCATIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FENTRYORGID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FENTRYORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FENTRYDC') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FENTRYDC VARCHAR(5) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FLOTID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FLOTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FLOTNUMBER') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FLOTNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FPRODUCEDATE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FPRODUCEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FEXPIRYDATE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FEXPIRYDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FWAREHOUSEID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FWAREHOUSEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FOWNERTYPE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FOWNERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FOWNERID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FOWNERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FKEEPERTYPE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FKEEPERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FKEEPERID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FKEEPERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FPROJECTID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FPROJECTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FINVTYPEID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FINVTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FENTRYINVSCHEMEID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FENTRYINVSCHEMEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FSUPLOT') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FSUPLOT NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FOUTINVTYPEID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FOUTINVTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FOUTINVSTATUSID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FOUTINVSTATUSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FPROVIDERSUPPLIERID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FPROVIDERSUPPLIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FPROVIDERLINKMANID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FPROVIDERLINKMANID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FINVOICESUPPLIERID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FINVOICESUPPLIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FRECEIVESUPPLIERID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FRECEIVESUPPLIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FOUTOWNERTYPE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FOUTOWNERTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FOUTOWNERID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FOUTOWNERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FOUTKEEPERTYPE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FOUTKEEPERTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FOUTKEEPERID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FOUTKEEPERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FENTRYSETTLEORGID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FENTRYSETTLEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FISPRESENT') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FISPRESENT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FPRICE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FPRICEANDTAX') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FPRICEANDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FTAXRATEID') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FTAXRATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FTAXRATE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FTAXRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FDISCOUNTTYPE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FDISCOUNTTYPE VARCHAR(5) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FDISCOUNTRATE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FDISCOUNTRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FAMOUNT') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FCURAMOUNT') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FCURAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FTAXAMOUNT') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FCURTAXAMOUNT') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FCURTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FDISCOUNTAMOUNT') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FDISCOUNTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FAMOUNTANDTAX') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FAMOUNTANDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FCURAMOUNTANDTAX') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FCURAMOUNTANDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FACTUALPRICE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FACTUALPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FACTUALTAXPRICE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FACTUALTAXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FEXRATETABLE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FEXRATETABLE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FCUSTOMERID') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FCUSTOMERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FRECCONDITIONID') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FRECCONDITIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FSETTLETYPEID') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FSETTLETYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FSETTLECURRENCYID') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FSETTLECURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FCURRENCYID') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FCURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FISTAX') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FISTAX CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FEXCHANGERATE') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FEXRATETABLE') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FEXRATETABLE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILL' AND KSQL_COL_NAME ='FPAYMODE') 
 ALTER TABLE T_IM_SALOUTBILL ADD (FPAYMODE NVARCHAR(30) DEFAULT 'CREDIT' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FPRICE') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FPRICEANDTAX') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FPRICEANDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FTAXRATE') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FTAXRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FTAXAMOUNT') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FCURTAXAMOUNT') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FCURTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FDISCOUNTTYPE') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FDISCOUNTTYPE VARCHAR(5) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FDISCOUNTRATE') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FDISCOUNTRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FDISCOUNTAMOUNT') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FDISCOUNTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FAMOUNT') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FCURAMOUNT') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FCURAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FAMOUNTANDTAX') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FAMOUNTANDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FCURAMOUNTANDTAX') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FCURAMOUNTANDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FENTRYSETTLEORGID') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FENTRYSETTLEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FTAXRATEID') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FTAXRATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FACTUALPRICE') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FACTUALPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FACTUALTAXPRICE') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FACTUALTAXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FMATERIALCOST') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FMATERIALCOST DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FUNITMATERIALCOST') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FUNITMATERIALCOST DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FPRICEUNITID') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FPRICEUNITID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FPRICEUNITRATE') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FPRICEUNITRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FPRICEQTY') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FPRICEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FENTRYCOMMENT') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FENTRYCOMMENT VARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FSERIALQTY') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FSERIALQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FSERIALUNITID') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FSERIALUNITID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FSERIALUNITRATE') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FSERIALUNITRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FOUTOWNERTYPE') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FOUTOWNERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FOUTOWNERID') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FOUTOWNERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FOUTKEEPERTYPE') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FOUTKEEPERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FOUTKEEPERID') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FOUTKEEPERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FOUTWAREHOUSEID') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FOUTWAREHOUSEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSDIRBILLENTRY' AND KSQL_COL_NAME ='FOUTLOCATIONID') 
 ALTER TABLE T_IM_TRANSDIRBILLENTRY ADD (FOUTLOCATIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FOUTORGID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FOUTORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FOUTWAREHOUSEID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FOUTWAREHOUSEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FOUTLOCATIONID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FOUTLOCATIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FOUTINVSTATUSID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FOUTINVSTATUSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FOUTINVTYPEID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FOUTINVTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FOUTPROJECTID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FOUTPROJECTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FOUTOWNERTYPE') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FOUTOWNERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FOUTOWNERID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FOUTOWNERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FOUTKEEPERTYPE') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FOUTKEEPERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSINBILLENTRY' AND KSQL_COL_NAME ='FOUTKEEPERID') 
 ALTER TABLE T_IM_TRANSINBILLENTRY ADD (FOUTKEEPERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FINORGID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FINORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FINWAREHOUSEID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FINWAREHOUSEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FINLOCATIONID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FINLOCATIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FENTERINVSTATUSID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FENTERINVSTATUSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FENTERINVTYPEID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FENTERINVTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FINPROJECTID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FINPROJECTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FINOWNERTYPE') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FINOWNERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FINOWNERID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FINOWNERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FINKEEPERTYPE') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FINKEEPERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FINKEEPERID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FINKEEPERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FOUTINVTYPEID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FOUTINVTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FOUTINVSTATUSID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FOUTINVSTATUSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FOUTOWNERTYPE') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FOUTOWNERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FOUTOWNERID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FOUTOWNERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FOUTKEEPERTYPE') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FOUTKEEPERTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_TRANSOUTBILLENTRY' AND KSQL_COL_NAME ='FOUTKEEPERID') 
 ALTER TABLE T_IM_TRANSOUTBILLENTRY ADD (FOUTKEEPERID BIGINT DEFAULT 0 NOT NULL );

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