--材料核销记录单据主体增加核销类别字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMMATRLWRFRECORD' AND KSQL_COL_NAME ='fwriteofftypeid') 
 ALTER TABLE T_IM_MDC_OMMATRLWRFRECORD ADD (fwriteofftypeid  BIGINT DEFAULT 0 NOT NULL);
 
--材料核销记录单据主体增加单据状态字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMMATRLWRFRECORD' AND KSQL_COL_NAME ='fbillstatus') 
 ALTER TABLE T_IM_MDC_OMMATRLWRFRECORD ADD (fbillstatus  NVARCHAR(30) DEFAULT ' ' NOT NULL);