/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILLQUOTE' AND KSQL_COL_NAME ='FQUOTEMATERIAL') 
 ALTER TABLE T_PUR_BIDBILLQUOTE ADD (FQUOTEMATERIAL BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILLQUOTE' AND KSQL_COL_NAME ='FMATERIALROWID') 
 ALTER TABLE T_PUR_BIDBILLQUOTE ADD (FMATERIALROWID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILLQUOTE' AND KSQL_COL_NAME ='FQUOTETAXPRICE') 
 ALTER TABLE T_PUR_BIDBILLQUOTE ADD (FQUOTETAXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILLQUOTE' AND KSQL_COL_NAME ='FQUOTEPRICE') 
 ALTER TABLE T_PUR_BIDBILLQUOTE ADD (FQUOTEPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILLQUOTE' AND KSQL_COL_NAME ='FQUOTAXRATEID') 
 ALTER TABLE T_PUR_BIDBILLQUOTE ADD (FQUOTAXRATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILLENTRY' AND KSQL_COL_NAME ='FWINSUPPLIERID') 
 ALTER TABLE T_PUR_BIDBILLENTRY ADD (FWINSUPPLIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILLENTRY' AND KSQL_COL_NAME ='FWINOPTION') 
 ALTER TABLE T_PUR_BIDBILLENTRY ADD (FWINOPTION NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILLENTRY' AND KSQL_COL_NAME ='FWINAMOUNT') 
 ALTER TABLE T_PUR_BIDBILLENTRY ADD (FWINAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILL' AND KSQL_COL_NAME ='FQUOTEMODE') 
 ALTER TABLE T_PUR_BIDBILL ADD (FQUOTEMODE CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILL' AND KSQL_COL_NAME ='FADDREMARK') 
 ALTER TABLE T_PUR_BIDBILL ADD (FADDREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL );

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