/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BEI_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKAGENTPAYBILL' AND KSQL_COL_NAME ='FISENCRYPTION') 
 ALTER TABLE T_BEI_BANKAGENTPAYBILL ADD (FISENCRYPTION CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FINCOMEADDS') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FINCOMEADDS NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FINCOMEAREACODE') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FINCOMEAREACODE NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FINCOMESWIFTCODE') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FINCOMESWIFTCODE NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FMOBILE') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FMOBILE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FEMAIL') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FEMAIL NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FINCOMEBANKCODE') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FINCOMEBANKCODE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FINCOMEBANKSUBCODE') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FINCOMEBANKSUBCODE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FINCOMERADDS') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FINCOMERADDS NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FINCOMERPROXYBANK') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FINCOMERPROXYBANK NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FINCOMECALPARAM') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FINCOMECALPARAM NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FISTRANSPAY') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FISTRANSPAY CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FUSECN') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FUSECN NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FEXPLANATION') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FEXPLANATION NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FTOLEXCHANGERATE') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FTOLEXCHANGERATE 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 ='FEXCONTRACT') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FEXCONTRACT NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPAYERFEETYPE') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPAYERFEETYPE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPAYERFEEACCNO') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPAYERFEEACCNO NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPAYERFEECURRENCYID') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPAYERFEECURRENCYID 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 ='FPAYMENTMETHOD') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPAYMENTMETHOD NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FSERVICELEVEL') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FSERVICELEVEL NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPAYCURRENCYID') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPAYCURRENCYID 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 ='FACTUALAMOUNT') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FACTUALAMOUNT 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 ='FTRANSREMARKS') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FTRANSREMARKS NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPROXYACCNO') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPROXYACCNO NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPROXYACCNAME') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPROXYACCNAME NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPROXYBANKCOUNTRY') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPROXYBANKCOUNTRY NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPROXYBANKAREA') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPROXYBANKAREA NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPROXYSWIFTCODE') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPROXYSWIFTCODE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPROXYBANKNAME') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPROXYBANKNAME NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FPROXYBANKADDS') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FPROXYBANKADDS NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FDELIVERYMETHOD') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FDELIVERYMETHOD NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FCHEQUETYPE') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FCHEQUETYPE NVARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_BANKPAYINGBILL_E' AND KSQL_COL_NAME ='FCHEQUEUSAGE') 
 ALTER TABLE T_BEI_BANKPAYINGBILL_E ADD (FCHEQUEUSAGE NVARCHAR(60) DEFAULT ' ' NOT NULL );

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