-- 是否需要影像扫描、是否启用发票云、是否与发票云交互
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYAPPLYBILL' AND KSQL_COL_NAME ='FNEEDIMAGESCAN')
ALTER TABLE T_ER_DAILYAPPLYBILL ADD (FNEEDIMAGESCAN CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYAPPLYBILL' AND KSQL_COL_NAME ='FISENABLEINVOICE')
ALTER TABLE T_ER_DAILYAPPLYBILL ADD (FISENABLEINVOICE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYAPPLYBILL' AND KSQL_COL_NAME ='FINVOKEINVOICECLOUD')
ALTER TABLE T_ER_DAILYAPPLYBILL ADD (FINVOKEINVOICECLOUD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_WITHHOLDINGBILL' AND KSQL_COL_NAME ='FNEEDIMAGESCAN')
ALTER TABLE T_ER_WITHHOLDINGBILL ADD (FNEEDIMAGESCAN CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_WITHHOLDINGBILL' AND KSQL_COL_NAME ='FISENABLEINVOICE')
ALTER TABLE T_ER_WITHHOLDINGBILL ADD (FISENABLEINVOICE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_WITHHOLDINGBILL' AND KSQL_COL_NAME ='FINVOKEINVOICECLOUD')
ALTER TABLE T_ER_WITHHOLDINGBILL ADD (FINVOKEINVOICECLOUD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_COSTESTIMATEBILL' AND KSQL_COL_NAME ='FNEEDIMAGESCAN')
ALTER TABLE T_ER_COSTESTIMATEBILL ADD (FNEEDIMAGESCAN CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_COSTESTIMATEBILL' AND KSQL_COL_NAME ='FISENABLEINVOICE')
ALTER TABLE T_ER_COSTESTIMATEBILL ADD (FISENABLEINVOICE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_COSTESTIMATEBILL' AND KSQL_COL_NAME ='FINVOKEINVOICECLOUD')
ALTER TABLE T_ER_COSTESTIMATEBILL ADD (FINVOKEINVOICECLOUD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CONTRACTBILL_S' AND KSQL_COL_NAME ='FNEEDIMAGESCAN')
ALTER TABLE T_ER_CONTRACTBILL_S ADD (FNEEDIMAGESCAN CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CONTRACTBILL_S' AND KSQL_COL_NAME ='FISENABLEINVOICE')
ALTER TABLE T_ER_CONTRACTBILL_S ADD (FISENABLEINVOICE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_CONTRACTBILL_S' AND KSQL_COL_NAME ='FINVOKEINVOICECLOUD')
ALTER TABLE T_ER_CONTRACTBILL_S ADD (FINVOKEINVOICECLOUD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTBILL_S' AND KSQL_COL_NAME ='FNEEDIMAGESCAN')
ALTER TABLE T_ER_APPLYPROJECTBILL_S ADD (FNEEDIMAGESCAN CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTBILL_S' AND KSQL_COL_NAME ='FISENABLEINVOICE')
ALTER TABLE T_ER_APPLYPROJECTBILL_S ADD (FISENABLEINVOICE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_APPLYPROJECTBILL_S' AND KSQL_COL_NAME ='FINVOKEINVOICECLOUD')
ALTER TABLE T_ER_APPLYPROJECTBILL_S ADD (FINVOKEINVOICECLOUD CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PREPAYBILL' AND KSQL_COL_NAME ='FNEEDIMAGESCAN')
ALTER TABLE T_ER_PREPAYBILL ADD (FNEEDIMAGESCAN CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PREPAYBILL' AND KSQL_COL_NAME ='FISENABLEINVOICE')
ALTER TABLE T_ER_PREPAYBILL ADD (FISENABLEINVOICE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PREPAYBILL' AND KSQL_COL_NAME ='FINVOKEINVOICECLOUD')
ALTER TABLE T_ER_PREPAYBILL ADD (FINVOKEINVOICECLOUD CHAR(1) DEFAULT '0' NOT NULL );


