/**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_RECEIPTENTRY_A' AND KSQL_COL_NAME ='FSUMINVOICEQTY') 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FSUMINVOICEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RETURNENTRY_A' AND KSQL_COL_NAME ='FSUMINVOICEQTY') 
 ALTER TABLE T_PUR_RETURNENTRY_A ADD (FSUMINVOICEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDERENTRY' AND KSQL_COL_NAME ='FPROMISEDAY') 
 ALTER TABLE T_PUR_ORDERENTRY ADD (FPROMISEDAY DATETIME );
 EXEC p_AlterColumn 'T_PUR_USER_L', 'FNAME', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY_A' AND KSQL_COL_NAME ='FPROMISEDAYOLD') 
 ALTER TABLE T_PUR_ORDCHANGENTRY_A ADD (FPROMISEDAYOLD DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_ORDCHANGENTRY' AND KSQL_COL_NAME ='FPROMISEDAY') 
 ALTER TABLE T_PUR_ORDCHANGENTRY ADD (FPROMISEDAY DATETIME );
 EXEC p_AlterColumn 'T_PUR_USER', 'FNAME', 'NVARCHAR(255)', 'NOT NULL', '0100', ''' ''';


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