-- 计划建议模板增加字段：供应规则，继承模板的单据都要增加对应的表字段
-- 计划建议、计划建议模板测试
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANORDER' AND KSQL_COL_NAME ='FSUPPLYRULE')
ALTER TABLE T_MRP_PLANORDER ADD (FSUPPLYRULE VARCHAR(50) NOT NULL DEFAULT ' ');

-- 模拟计划建议
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMULATEORDER' AND KSQL_COL_NAME ='FSUPPLYRULE')
ALTER TABLE T_MRP_SIMULATEORDER ADD (FSUPPLYRULE VARCHAR(50) NOT NULL DEFAULT ' ');

-- 计划建议变更单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_XPLANORDER' AND KSQL_COL_NAME ='FSUPPLYRULE')
ALTER TABLE T_MRP_XPLANORDER ADD (FSUPPLYRULE VARCHAR(50) NOT NULL DEFAULT ' ');