/**Begin D:\PDM_UPGRADE\PDM1\BEI_table.sql **/
-- 银行付款单异币别付款相关字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME IN ('FISDIFFCUR'))
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FISDIFFCUR CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME IN ('FPAYERFEE'))
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPAYERFEE DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME IN ('FEXCHANGECURRENCYID'))
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FEXCHANGECURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME IN ('FEXCHANGEAMOUNT'))
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FEXCHANGEAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME IN ('FAGREEDRATE'))
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FAGREEDRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME IN ('FPAYMENTANTURE'))
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPAYMENTANTURE NVARCHAR(50) DEFAULT ' ' NOT NULL );

/**End D:\PDM_UPGRADE\PDM1\BEI_table.sql **/

