/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\ER_table.sql 还款单还款明细增加源单类型**/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_REPAYMENTENTRY' AND KSQL_COL_NAME ='FSRCBILLTYPE') 
 ALTER TABLE T_ER_REPAYMENTENTRY ADD (FSRCBILLTYPE VARCHAR(200) DEFAULT ' ' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_REPAYMENTENTRY' AND KSQL_COL_NAME ='FSOURCEBILLNO') 
 ALTER TABLE T_ER_REPAYMENTENTRY ADD (FSOURCEBILLNO VARCHAR(100) DEFAULT ' ' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_REPAYMENTENTRY' AND KSQL_COL_NAME ='FSOURCEBILLID') 
 ALTER TABLE T_ER_REPAYMENTENTRY ADD (FSOURCEBILLID VARCHAR(100) DEFAULT ' ' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_REPAYMENTENTRY' AND KSQL_COL_NAME ='FSOURCEENTRYID') 
 ALTER TABLE T_ER_REPAYMENTENTRY ADD (FSOURCEENTRYID VARCHAR(100) DEFAULT ' ' NOT NULL );

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