/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FUNRELATEINVQTY') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FUNRELATEINVQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FRELATEINVQTY') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FRELATEINVQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FUNRELATEINVAMT') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FUNRELATEINVAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FUNRELATEINVLOCAMT') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FUNRELATEINVLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FRELATEINVAMT') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FRELATEINVAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FRELATEINVLOCAMT') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FRELATEINVLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FINVQTY')
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FINVQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FINVNOTAXAMT') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FINVNOTAXAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FINVNOTAXLOCAMT') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FINVNOTAXLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FINVOICEDTAX') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FINVOICEDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FINVOICEDLOCTAX') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FINVOICEDLOCTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FINVAMT') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FINVAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILLENTRY_E' AND KSQL_COL_NAME ='FINVLOCAMT') 
 ALTER TABLE T_AR_BUSBILLENTRY_E ADD (FINVLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILL' AND KSQL_COL_NAME ='FUNRELATEINVAMT') 
 ALTER TABLE T_AR_BUSBILL ADD (FUNRELATEINVAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILL' AND KSQL_COL_NAME ='FUNRELATEINVLOCAMT') 
 ALTER TABLE T_AR_BUSBILL ADD (FUNRELATEINVLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILL' AND KSQL_COL_NAME ='FRELATEINVAMT') 
 ALTER TABLE T_AR_BUSBILL ADD (FRELATEINVAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILL' AND KSQL_COL_NAME ='FRELATEINVLOCAMT') 
 ALTER TABLE T_AR_BUSBILL ADD (FRELATEINVLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILL' AND KSQL_COL_NAME ='FINVAMT') 
 ALTER TABLE T_AR_BUSBILL ADD (FINVAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BUSBILL' AND KSQL_COL_NAME ='FINVLOCAMT') 
 ALTER TABLE T_AR_BUSBILL ADD (FINVLOCAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );

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