/**付款信息分录 加上异币种付款相关字段 **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYREIMPAYENTRY' AND KSQL_COL_NAME ='FDPCURRENCY') 
 ALTER TABLE T_ER_DAILYREIMPAYENTRY ADD (FDPCURRENCY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYREIMPAYENTRY' AND KSQL_COL_NAME ='FDPEXCHANGERATE') 
 ALTER TABLE T_ER_DAILYREIMPAYENTRY ADD (FDPEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYREIMPAYENTRY' AND KSQL_COL_NAME ='FDPAMT') 
 ALTER TABLE T_ER_DAILYREIMPAYENTRY ADD (FDPAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYREIMPAYENTRY' AND KSQL_COL_NAME ='FDPLOCALAMT') 
 ALTER TABLE T_ER_DAILYREIMPAYENTRY ADD (FDPLOCALAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYREIMPAYENTRY' AND KSQL_COL_NAME ='FAGREEDRATE') 
 ALTER TABLE T_ER_DAILYREIMPAYENTRY ADD (FAGREEDRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYREIMPAYENTRY' AND KSQL_COL_NAME ='FLOSSAMT') 
 ALTER TABLE T_ER_DAILYREIMPAYENTRY ADD (FLOSSAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYREIMPAYENTRY' AND KSQL_COL_NAME ='FFEE') 
 ALTER TABLE T_ER_DAILYREIMPAYENTRY ADD (FFEE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYREIMPAYENTRY' AND KSQL_COL_NAME ='FFEECURRENCY') 
 ALTER TABLE T_ER_DAILYREIMPAYENTRY ADD (FFEECURRENCY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_LOANBILLPAYENTRY' AND KSQL_COL_NAME ='FDPCURRENCY') 
 ALTER TABLE T_ER_LOANBILLPAYENTRY ADD (FDPCURRENCY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_LOANBILLPAYENTRY' AND KSQL_COL_NAME ='FDPEXCHANGERATE') 
 ALTER TABLE T_ER_LOANBILLPAYENTRY ADD (FDPEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_LOANBILLPAYENTRY' AND KSQL_COL_NAME ='FDPAMT') 
 ALTER TABLE T_ER_LOANBILLPAYENTRY ADD (FDPAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_LOANBILLPAYENTRY' AND KSQL_COL_NAME ='FDPLOCALAMT') 
 ALTER TABLE T_ER_LOANBILLPAYENTRY ADD (FDPLOCALAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_LOANBILLPAYENTRY' AND KSQL_COL_NAME ='FAGREEDRATE') 
 ALTER TABLE T_ER_LOANBILLPAYENTRY ADD (FAGREEDRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_LOANBILLPAYENTRY' AND KSQL_COL_NAME ='FLOSSAMT') 
 ALTER TABLE T_ER_LOANBILLPAYENTRY ADD (FLOSSAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_LOANBILLPAYENTRY' AND KSQL_COL_NAME ='FFEE') 
 ALTER TABLE T_ER_LOANBILLPAYENTRY ADD (FFEE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_LOANBILLPAYENTRY' AND KSQL_COL_NAME ='FFEECURRENCY') 
 ALTER TABLE T_ER_LOANBILLPAYENTRY ADD (FFEECURRENCY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBLICREIMPAYENTRY' AND KSQL_COL_NAME ='FDPCURRENCY') 
 ALTER TABLE T_ER_PUBLICREIMPAYENTRY ADD (FDPCURRENCY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBLICREIMPAYENTRY' AND KSQL_COL_NAME ='FDPEXCHANGERATE') 
 ALTER TABLE T_ER_PUBLICREIMPAYENTRY ADD (FDPEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBLICREIMPAYENTRY' AND KSQL_COL_NAME ='FDPAMT') 
 ALTER TABLE T_ER_PUBLICREIMPAYENTRY ADD (FDPAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBLICREIMPAYENTRY' AND KSQL_COL_NAME ='FDPLOCALAMT') 
 ALTER TABLE T_ER_PUBLICREIMPAYENTRY ADD (FDPLOCALAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBLICREIMPAYENTRY' AND KSQL_COL_NAME ='FAGREEDRATE') 
 ALTER TABLE T_ER_PUBLICREIMPAYENTRY ADD (FAGREEDRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBLICREIMPAYENTRY' AND KSQL_COL_NAME ='FLOSSAMT') 
 ALTER TABLE T_ER_PUBLICREIMPAYENTRY ADD (FLOSSAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBLICREIMPAYENTRY' AND KSQL_COL_NAME ='FFEE') 
 ALTER TABLE T_ER_PUBLICREIMPAYENTRY ADD (FFEE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBLICREIMPAYENTRY' AND KSQL_COL_NAME ='FFEECURRENCY') 
 ALTER TABLE T_ER_PUBLICREIMPAYENTRY ADD (FFEECURRENCY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREIMPAYENTRY' AND KSQL_COL_NAME ='FDPCURRENCY') 
 ALTER TABLE T_ER_TRIPREIMPAYENTRY ADD (FDPCURRENCY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREIMPAYENTRY' AND KSQL_COL_NAME ='FDPEXCHANGERATE') 
 ALTER TABLE T_ER_TRIPREIMPAYENTRY ADD (FDPEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREIMPAYENTRY' AND KSQL_COL_NAME ='FDPAMT') 
 ALTER TABLE T_ER_TRIPREIMPAYENTRY ADD (FDPAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREIMPAYENTRY' AND KSQL_COL_NAME ='FDPLOCALAMT') 
 ALTER TABLE T_ER_TRIPREIMPAYENTRY ADD (FDPLOCALAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREIMPAYENTRY' AND KSQL_COL_NAME ='FAGREEDRATE') 
 ALTER TABLE T_ER_TRIPREIMPAYENTRY ADD (FAGREEDRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREIMPAYENTRY' AND KSQL_COL_NAME ='FLOSSAMT') 
 ALTER TABLE T_ER_TRIPREIMPAYENTRY ADD (FLOSSAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREIMPAYENTRY' AND KSQL_COL_NAME ='FFEE') 
 ALTER TABLE T_ER_TRIPREIMPAYENTRY ADD (FFEE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREIMPAYENTRY' AND KSQL_COL_NAME ='FFEECURRENCY') 
 ALTER TABLE T_ER_TRIPREIMPAYENTRY ADD (FFEECURRENCY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREQPAYENTRY' AND KSQL_COL_NAME ='FDPCURRENCY') 
 ALTER TABLE T_ER_TRIPREQPAYENTRY ADD (FDPCURRENCY BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREQPAYENTRY' AND KSQL_COL_NAME ='FDPEXCHANGERATE') 
 ALTER TABLE T_ER_TRIPREQPAYENTRY ADD (FDPEXCHANGERATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREQPAYENTRY' AND KSQL_COL_NAME ='FDPAMT') 
 ALTER TABLE T_ER_TRIPREQPAYENTRY ADD (FDPAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREQPAYENTRY' AND KSQL_COL_NAME ='FDPLOCALAMT') 
 ALTER TABLE T_ER_TRIPREQPAYENTRY ADD (FDPLOCALAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREQPAYENTRY' AND KSQL_COL_NAME ='FAGREEDRATE') 
 ALTER TABLE T_ER_TRIPREQPAYENTRY ADD (FAGREEDRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREQPAYENTRY' AND KSQL_COL_NAME ='FLOSSAMT') 
 ALTER TABLE T_ER_TRIPREQPAYENTRY ADD (FLOSSAMT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREQPAYENTRY' AND KSQL_COL_NAME ='FFEE') 
 ALTER TABLE T_ER_TRIPREQPAYENTRY ADD (FFEE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPREQPAYENTRY' AND KSQL_COL_NAME ='FFEECURRENCY') 
 ALTER TABLE T_ER_TRIPREQPAYENTRY ADD (FFEECURRENCY BIGINT DEFAULT 0 NOT NULL );

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