--摊销明细增加转出金额字段，主要涉及费用报销单、对公报报销单、差旅报销单、费用分摊单
--费用报销单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYRESHAREDETAIL' AND KSQL_COL_NAME ='FITEMINOUTAMOUNT')
ALTER TABLE T_ER_DAILYRESHAREDETAIL ADD (FITEMINOUTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL);

--对公报销单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBLICRESHAREDETAIL' AND KSQL_COL_NAME ='FITEMINOUTAMOUNT')
ALTER TABLE T_ER_PUBLICRESHAREDETAIL ADD (FITEMINOUTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL);

--差旅报销单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_TRIPRESHAREDETAIL' AND KSQL_COL_NAME ='FITEMINOUTAMOUNT')
ALTER TABLE T_ER_TRIPRESHAREDETAIL ADD (FITEMINOUTAMOUNT 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 ='FITEMINOUTAMOUNT')
ALTER TABLE T_ER_EXPENSESHAREDETAIL ADD (FITEMINOUTAMOUNT 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 ='FITEMINOUTAMOUNT')
ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FITEMINOUTAMOUNT 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 ='FTHISITEMINOUTAMOUNT')
ALTER TABLE T_ER_EXPENSESHAREWAIT ADD (FTHISITEMINOUTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL);

