
/*** 酒水标准标准功能新增的单据字段 -- 费用申请单分录、费用报销单分录、对公报销单分录 **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYAPPLYDETAIL' AND KSQL_COL_NAME ='FOTHERFEEAMOUNT') 
 ALTER TABLE T_ER_DAILYAPPLYDETAIL ADD (FOTHERFEEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYAPPLYDETAIL' AND KSQL_COL_NAME ='FOTHERSTANDAMOUNT') 
 ALTER TABLE T_ER_DAILYAPPLYDETAIL ADD (FOTHERSTANDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_DAILYAPPLYDETAIL' AND KSQL_COL_NAME ='FOTHERSTANDARDDESC') 
 ALTER TABLE T_ER_DAILYAPPLYDETAIL ADD (FOTHERSTANDARDDESC NVARCHAR(255) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSEDETAIL' AND KSQL_COL_NAME ='FOTHERFEEAMOUNT') 
 ALTER TABLE T_ER_EXPENSEDETAIL ADD (FOTHERFEEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSEDETAIL' AND KSQL_COL_NAME ='FOTHERSTANDAMOUNT') 
 ALTER TABLE T_ER_EXPENSEDETAIL ADD (FOTHERSTANDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_EXPENSEDETAIL' AND KSQL_COL_NAME ='FOTHERSTANDARDDESC') 
 ALTER TABLE T_ER_EXPENSEDETAIL ADD (FOTHERSTANDARDDESC NVARCHAR(255) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET_A' AND KSQL_COL_NAME ='FOTHERFEEAMOUNT') 
 ALTER TABLE T_ER_PUBREIMEXPDET_A ADD (FOTHERFEEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET_A' AND KSQL_COL_NAME ='FOTHERSTANDAMOUNT') 
 ALTER TABLE T_ER_PUBREIMEXPDET_A ADD (FOTHERSTANDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET_A' AND KSQL_COL_NAME ='FOTHERSTANDARDDESC') 
 ALTER TABLE T_ER_PUBREIMEXPDET_A ADD (FOTHERSTANDARDDESC NVARCHAR(255) DEFAULT ' ' NOT NULL );

/*** 酒水标准基础资料新增字段 **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_FEE_STANDARD' AND KSQL_COL_NAME ='FOTHERSTAND') 
 ALTER TABLE T_ER_FEE_STANDARD ADD (FOTHERSTAND CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_FEE_STANDARD' AND KSQL_COL_NAME ='FOTHERSTANDAMOUNT') 
 ALTER TABLE T_ER_FEE_STANDARD ADD (FOTHERSTANDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL);