-- 生产领料单 增加 单据实体字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_mdc_mreqoutbill' AND KSQL_COL_NAME ='fbillentity') 
 ALTER TABLE t_im_mdc_mreqoutbill ADD (fbillentity NVARCHAR(50) DEFAULT ' ' NOT NULL );
 
-- 完工入库单 增加 单据实体字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_mdc_productinbill' AND KSQL_COL_NAME ='fbillentity') 
 ALTER TABLE t_im_mdc_productinbill ADD (fbillentity NVARCHAR(50) DEFAULT ' ' NOT NULL );
 
-- 委外领料单 增加 单据实体字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_mdc_omoutbill' AND KSQL_COL_NAME ='fbillentity') 
 ALTER TABLE t_im_mdc_omoutbill ADD (fbillentity NVARCHAR(50) DEFAULT ' ' NOT NULL );
 
-- 简单委外领料单 增加 单据实体字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_im_mdcom_mreqoutbill' AND KSQL_COL_NAME ='fbillentity') 
 ALTER TABLE t_im_mdcom_mreqoutbill ADD (fbillentity NVARCHAR(50) DEFAULT ' ' NOT NULL );