-- 火车订单添加 发票流水号 发票识别异常信息
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINBILL' AND KSQL_COL_NAME ='FSERIALNO')
 ALTER TABLE T_ER_TRAINBILL ADD (FSERIALNO VARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINBILL' AND KSQL_COL_NAME ='FIDENTITYERRORMSG')
ALTER TABLE T_ER_TRAINBILL ADD (FIDENTITYERRORMSG VARCHAR(2000) DEFAULT ' ' NOT NULL);

-- 火车结算单添加 发票流水号 发票识别异常信息 是否发票识别成功
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINCHECKINGBILL' AND KSQL_COL_NAME ='FSERIALNO')
 ALTER TABLE T_ER_TRAINCHECKINGBILL ADD (FSERIALNO VARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINCHECKINGBILL' AND KSQL_COL_NAME ='FIDENTITYERRORMSG')
ALTER TABLE T_ER_TRAINCHECKINGBILL ADD (FIDENTITYERRORMSG VARCHAR(500) DEFAULT ' ' NOT NULL);
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRAINCHECKINGBILL' AND KSQL_COL_NAME ='FINVOICEIDENTITYFLAG')
ALTER TABLE T_ER_TRAINCHECKINGBILL ADD (FINVOICEIDENTITYFLAG VARCHAR(10) DEFAULT 0 NOT NULL);


-- 机票订单添加 发票流水号 发票识别异常信息
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PLANEBILL' AND KSQL_COL_NAME ='FSERIALNO')
ALTER TABLE T_ER_PLANEBILL ADD (FSERIALNO VARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PLANEBILL' AND KSQL_COL_NAME ='FIDENTITYERRORMSG')
ALTER TABLE T_ER_PLANEBILL ADD (FIDENTITYERRORMSG VARCHAR(2000) DEFAULT ' ' NOT NULL);

-- 机票结算单添加 发票流水号 发票识别异常信息 是否发票识别成功
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PLANECHECKINGBILL' AND KSQL_COL_NAME ='FSERIALNO')
ALTER TABLE T_ER_PLANECHECKINGBILL ADD (FSERIALNO VARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PLANECHECKINGBILL' AND KSQL_COL_NAME ='FIDENTITYERRORMSG')
ALTER TABLE T_ER_PLANECHECKINGBILL ADD (FIDENTITYERRORMSG VARCHAR(500) DEFAULT ' ' NOT NULL);
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PLANECHECKINGBILL' AND KSQL_COL_NAME ='FINVOICEIDENTITYFLAG')
ALTER TABLE T_ER_PLANECHECKINGBILL ADD (FINVOICEIDENTITYFLAG VARCHAR(10) DEFAULT 0 NOT NULL);


