/**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 ='FINVOICEQTY') 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FINVOICEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_RECEIPTENTRY_A' AND KSQL_COL_NAME ='FINVOICEAMT') 
 ALTER TABLE T_PUR_RECEIPTENTRY_A ADD (FINVOICEAMT 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 ='FINVOICEQTY') 
 ALTER TABLE T_PUR_RETURNENTRY_A ADD (FINVOICEQTY 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 ='FINVOICEAMT') 
 ALTER TABLE T_PUR_RETURNENTRY_A ADD (FINVOICEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
 EXEC p_AlterColumn 'T_PUR_ORDERENTRY_A', 'FINVOICEQTY', 'DECIMAL(23,10)', 'NOT NULL', '0100', '0';

 EXEC p_AlterColumn 'T_PUR_ORDERENTRY_A', 'FINVOICEAMT', 'DECIMAL(23,10)', 'NOT NULL', '0100', '0';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INSTOCKENTRY_A' AND KSQL_COL_NAME ='FINVOICEQTY') 
 ALTER TABLE T_PUR_INSTOCKENTRY_A ADD (FINVOICEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INSTOCKENTRY_A' AND KSQL_COL_NAME ='FINVOICEAMT') 
 ALTER TABLE T_PUR_INSTOCKENTRY_A ADD (FINVOICEAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PUR_table.sql **/
