/**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_INVOICENTRY2_A' AND KSQL_COL_NAME ='FENTRYJDORDERID') 
 ALTER TABLE T_PUR_INVOICENTRY2_A ADD (FENTRYJDORDERID BIGINT DEFAULT 0 NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_USER' AND KSQL_COL_NAME ='FPHONE') 
 ALTER TABLE T_PUR_USER ADD (FPHONE VARCHAR(20) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INQUIRYENTRY' AND KSQL_COL_NAME ='FTAXRATEID') 
 ALTER TABLE T_PUR_INQUIRYENTRY ADD (FTAXRATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_QUOTENTRY' AND KSQL_COL_NAME ='FTAXRATEID') 
 ALTER TABLE T_PUR_QUOTENTRY ADD (FTAXRATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_COMPARENTRY' AND KSQL_COL_NAME ='FTAXRATEID') 
 ALTER TABLE T_PUR_COMPARENTRY ADD (FTAXRATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_BIDBILLENTRY' AND KSQL_COL_NAME ='FTAXRATEID') 
 ALTER TABLE T_PUR_BIDBILLENTRY ADD (FTAXRATEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SALOUTSTOCKENTRY' AND KSQL_COL_NAME ='FREJECTQTY') 
 ALTER TABLE T_PUR_SALOUTSTOCKENTRY ADD (FREJECTQTY DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SALOUTSTOCKENTRY' AND KSQL_COL_NAME ='FREJECTREASON') 
 ALTER TABLE T_PUR_SALOUTSTOCKENTRY ADD (FREJECTREASON NVARCHAR(255) DEFAULT ' ' NOT NULL );
 
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PUR_table.sql **/
