/**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_BADDEBTPREPARE' AND KSQL_COL_NAME ='FINDIVIDUALREASON') 
 ALTER TABLE T_AR_BADDEBTPREPARE ADD (FINDIVIDUALREASON NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BADDEBTACCRUE' AND KSQL_COL_NAME ='FEXRATETABLEID') 
 ALTER TABLE T_AR_BADDEBTACCRUE ADD (FEXRATETABLEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_BADDEBTACCRUE' AND KSQL_COL_NAME ='FEXRATEDATE') 
 ALTER TABLE T_AR_BADDEBTACCRUE ADD (FEXRATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_ACCRUALPLANENTRY_L' AND KSQL_COL_NAME ='FENTRYID') 
 ALTER TABLE T_AR_ACCRUALPLANENTRY_L ADD (FENTRYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_ACCRUALPLANENTRY' AND KSQL_COL_NAME ='FREMARK') 
 ALTER TABLE T_AR_ACCRUALPLANENTRY ADD (FREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_ACCRUALPLANENTRY' AND KSQL_COL_NAME ='FACCRUALCONTEXT') 
 ALTER TABLE T_AR_ACCRUALPLANENTRY ADD (FACCRUALCONTEXT VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_ACCRUALPLANENTRY' AND KSQL_COL_NAME ='FAGINGGROUPID') 
 ALTER TABLE T_AR_ACCRUALPLANENTRY ADD (FAGINGGROUPID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_ACCRUALPLANENTRY' AND KSQL_COL_NAME ='FOFFSETREMARK') 
 ALTER TABLE T_AR_ACCRUALPLANENTRY ADD (FOFFSETREMARK NVARCHAR(512) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_AR_ACCRUALPLANENTRY' AND KSQL_COL_NAME ='FINCLUDEPERIOD') 
 ALTER TABLE T_AR_ACCRUALPLANENTRY ADD (FINCLUDEPERIOD CHAR(1) DEFAULT '1' NOT NULL );
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_table.sql **/
