--生产领料单增加领料类型
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_MREQOUTBILL_M' AND KSQL_COL_NAME ='FREQTYPE')
ALTER TABLE T_IM_MDC_MREQOUTBILL_M ADD (FREQTYPE NVARCHAR(50)  DEFAULT 'A' NOT NULL);
--委外领料单增加领料类型
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMOUTBILL_M' AND KSQL_COL_NAME ='FREQTYPE')
ALTER TABLE T_IM_MDC_OMOUTBILL_M ADD (FREQTYPE NVARCHAR(50)  DEFAULT 'A' NOT NULL);

--委外领料单分录增加字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMOUTBILLENTRY_M' AND KSQL_COL_NAME ='FISADD')
ALTER TABLE T_IM_MDC_OMOUTBILLENTRY_M ADD (FISADD CHAR(1) DEFAULT '0' NOT NULL);
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMOUTBILLENTRY_M' AND KSQL_COL_NAME ='FFEEDREASON')
ALTER TABLE T_IM_MDC_OMOUTBILLENTRY_M ADD (FFEEDREASON BIGINT DEFAULT 0 NOT NULL);
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMOUTBILLENTRY_M' AND KSQL_COL_NAME ='FUPDATESTOCKRESULT')
ALTER TABLE T_IM_MDC_OMOUTBILLENTRY_M ADD (FUPDATESTOCKRESULT NVARCHAR(50)  DEFAULT 'A' NOT NULL);

