/**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_BADDEBTPREPAREENTRY' AND KSQL_COL_NAME ='FAGINGRANGE') 
 ALTER TABLE T_AR_BADDEBTPREPAREENTRY ADD (FAGINGRANGE NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BADDEBTPREPAREENTRY' AND KSQL_COL_NAME ='FACCRUALPERCENT') 
 ALTER TABLE T_AR_BADDEBTPREPAREENTRY ADD (FACCRUALPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BALANCE' AND KSQL_COL_NAME ='FPERIODBUSNOTAXAMT')
 ALTER TABLE T_AR_BALANCE ADD (FPERIODBUSNOTAXAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BALANCE' AND KSQL_COL_NAME ='FLOCALPERIODBUSNOTAXAMT')
 ALTER TABLE T_AR_BALANCE ADD (FLOCALPERIODBUSNOTAXAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BALANCE' AND KSQL_COL_NAME ='FBUSNOTAXAMT')
 ALTER TABLE T_AR_BALANCE ADD (FBUSNOTAXAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BALANCE' AND KSQL_COL_NAME ='FLOCALBUSNOTAXAMT')
 ALTER TABLE T_AR_BALANCE ADD (FLOCALBUSNOTAXAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BALANCE' AND KSQL_COL_NAME ='FBUSNOTAXBALANCE')
 ALTER TABLE T_AR_BALANCE ADD (FBUSNOTAXBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BALANCE' AND KSQL_COL_NAME ='FLOCALBUSNOTAXBALANCE')
 ALTER TABLE T_AR_BALANCE ADD (FLOCALBUSNOTAXBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL );

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