-- 协同计划单增加字段：已调拨基本数量、剩余调拨基本数量
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_RATIVEORDER' AND KSQL_COL_NAME ='FTRANSFERQTY')
ALTER TABLE T_MRP_RATIVEORDER ADD (FTRANSFERQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_RATIVEORDER' AND KSQL_COL_NAME ='FRESIDUALTRANSFERQTY')
ALTER TABLE T_MRP_RATIVEORDER ADD (FRESIDUALTRANSFERQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );

-- 模拟协同计划单增加字段：已调拨基本数量、剩余调拨基本数量
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMCOLORDER' AND KSQL_COL_NAME ='FTRANSFERQTY')
ALTER TABLE T_MRP_SIMCOLORDER ADD (FTRANSFERQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_SIMCOLORDER' AND KSQL_COL_NAME ='FRESIDUALTRANSFERQTY')
ALTER TABLE T_MRP_SIMCOLORDER ADD (FRESIDUALTRANSFERQTY DECIMAL(23,10) DEFAULT 0 NOT NULL );