IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREBILL' AND KSQL_COL_NAME ='FSUMSHARERATE')
 ALTER TABLE T_ER_EXPENSESHAREBILL ADD (FSUMSHARERATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREBILL' AND KSQL_COL_NAME ='FSHARERULESTARTDATE')
  ALTER TABLE T_ER_EXPENSESHAREBILL ADD (FSHARERULESTARTDATE DATETIME );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREBILL' AND KSQL_COL_NAME ='FSHARERULEENDDATE')
  ALTER TABLE T_ER_EXPENSESHAREBILL ADD (FSHARERULEENDDATE DATETIME );

/** 费用分摊单添加字段 **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREWAIT' AND KSQL_COL_NAME ='FPRICE') 
 ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREWAIT' AND KSQL_COL_NAME ='FTHISAPPLYAMOUNT')
 ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FTHISAPPLYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREWAIT' AND KSQL_COL_NAME ='FTHISCURRAPPLYAMOUNT')
 ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FTHISCURRAPPLYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREWAIT' AND KSQL_COL_NAME ='FTHISTAX')
 ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FTHISTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREWAIT' AND KSQL_COL_NAME ='FTHISNOTAX')
 ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FTHISNOTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREWAIT' AND KSQL_COL_NAME ='FTHISAPPROVEAMOUNT')
 ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FTHISAPPROVEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREWAIT' AND KSQL_COL_NAME ='FTHISAPPROVECURRAMOUNT')
 ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FTHISAPPROVECURRAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREWAIT' AND KSQL_COL_NAME ='FTHISAPPORVETAX')
 ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FTHISAPPORVETAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREWAIT' AND KSQL_COL_NAME ='FTHISAPPROVENOTAX')
 ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FTHISAPPROVENOTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREWAIT' AND KSQL_COL_NAME ='FENTRYSHAREDAMOUNT')
  ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FENTRYSHAREDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );

 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREDETAIL' AND KSQL_COL_NAME ='FPRICE') 
 ALTER TABLE T_ER_EXPENSESHAREDETAIL ADD (FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHAREDETAIL' AND KSQL_COL_NAME ='FENTRYMONTH') 
 ALTER TABLE T_ER_EXPENSESHAREDETAIL ADD (FENTRYMONTH DATETIME );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSESHARERULE' AND KSQL_COL_NAME ='FENTRYMONTH') 
 ALTER TABLE T_ER_EXPENSESHARERULE ADD (FENTRYMONTH DATETIME );

