/**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_GOODSLINKTAXTYPE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_AR_GOODSLINKTAXTYPE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_SETTLESCHEME' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_AR_SETTLESCHEME ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_SOURCETYPE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_AR_SOURCETYPE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_POLICYTYPE' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_AR_POLICYTYPE ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_POLICY' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_AR_POLICY ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_ACCRUALSCHEME' AND KSQL_COL_NAME ='FNAME') 
 ALTER TABLE T_AR_ACCRUALSCHEME ADD (FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_SETTLESCHERULEENTRY' AND KSQL_COL_NAME ='FASSTBILL') 
 ALTER TABLE T_AR_SETTLESCHERULEENTRY ADD (FASSTBILL VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BADDEBTRESULT' AND KSQL_COL_NAME ='FISFIRST') 
 ALTER TABLE T_AR_BADDEBTRESULT ADD (FISFIRST CHAR(1) DEFAULT '0' NOT NULL );

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