/*  商旅付款申请单结算分录行程单发票匹配 */

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CHECKINGPAY' AND KSQL_COL_NAME ='FDIFFERENTTAX')
ALTER TABLE T_ER_CHECKINGPAY ADD (FDIFFERENTTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CHECKINGPAYENTRY' AND KSQL_COL_NAME ='FTICKETNUM')
ALTER TABLE T_ER_CHECKINGPAYENTRY ADD (fticketnum VARCHAR(50) DEFAULT ' ' NOT NULL  );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CHECKINGPAYENTRY' AND KSQL_COL_NAME ='FTRAVELBILL')
ALTER TABLE T_ER_CHECKINGPAYENTRY ADD (ftravelbill CHAR(1) DEFAULT '0' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CHECKINGPAYENTRY' AND KSQL_COL_NAME ='FMATCH')
ALTER TABLE T_ER_CHECKINGPAYENTRY ADD (fmatch CHAR(1) DEFAULT '0' NOT NULL  );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_INVOICEINFOCP' AND KSQL_COL_NAME ='FINVOICEMATCH')
ALTER TABLE T_ER_INVOICEINFOCP ADD (FINVOICEMATCH CHAR(1) DEFAULT '0' NOT NULL  );

