/**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_PURRECBILLENTRY_R' AND KSQL_COL_NAME ='FCONCESSIONQTY') 
 ALTER TABLE T_IM_PURRECBILLENTRY_R ADD (FCONCESSIONQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURRECBILLENTRY_R' AND KSQL_COL_NAME ='FCONCESSIONBASEQTY') 
 ALTER TABLE T_IM_PURRECBILLENTRY_R ADD (FCONCESSIONBASEQTY 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 ='FISINSPECT') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FISINSPECT 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 ='FEMRELEASE') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FEMRELEASE 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 ='FTOTALINSPQTY') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FTOTALINSPQTY 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 ='FTOTALINSPBASEQTY') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FTOTALINSPBASEQTY 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 ='FLEFTINSPQTY') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FLEFTINSPQTY 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 ='FLEFTINSPBASEQTY') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FLEFTINSPBASEQTY 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 ='FTOTALUNQUALRETURNQTY') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FTOTALUNQUALRETURNQTY 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 ='FTOTALUNQUALRETURNBASEQTY') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (FTOTALUNQUALRETURNBASEQTY 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 ='fleftunqualreturnqty') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (fleftunqualreturnqty 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 ='fleftunqualreturnbaseqty') 
 ALTER TABLE T_IM_PURRECBILLENTRY ADD (fleftunqualreturnbaseqty DECIMAL(23,10) DEFAULT 0 NOT NULL );
 
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
