COMPILE ROUTINE FIX_WM_IN(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE obj_Schedule,Send_Dyn,Send_Infom, obj_Order, obj_WO_Log, RList, RList, ErrMsg
DECLARE SUBROUTIne obj_WO_Step, Set_Status, Send_Info, obj_WM_In, obj_WO_Mat, obj_WM_Out
DECLARE FUNCTION Get_Status, Set_Printer, Get_Status, obj_WM_IN

$INSERT WM_IN_EQUATES
$INSERT WO_MAT_EQUATES

OPEN 'WO_MAT' TO WOMatTable ELSE
	DEBUG
	GOTO Bail
END

OPEN 'WM_IN' TO WMITable  ELSE
	DEBUG
	GOTO Bail
END



SELECT WMITable
debug

RecCnt = 0
FixCnt = 0
Done = 0
LOOP
	READNEXT WMIKey ELSE Done = 1
UNTIL DONE
	READ WMIRec FROM WMITable,WMIKey THEN
		RecCnt += 1
		WriteFlag = 0
		
		CurrStatus = obj_WM_In('CurrStatus',WMIKey:@RM:WMIRec)
	
		IF CurrStatus = 'RFW' THEN
		
			WRITE WMIRec ON WMITable,WMIKey THEN
				Send_Dyn(WMIKey:' ':CurrStatus)
				FixCnt += 1
			END
		END
		Send_Info(RecCnt:' ':FixCnt)
		
	END
REPEAT



* * * * * *
Bail:
* * * * * *

END


