COMPILE ROUTINE MOVE_WO_MATERIAL(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE obj_Schedule,Send_Dyn,Send_Info, obj_WO_Log, Set_Status, obj_WO_Step, RList, obj_WO_Mat
DECLARE SUBROUTINE obj_WO_Mat_QA, Btree.Extract
DECLARE SUBROUTINE ErrMsg, RDS_React_Run, obj_Post_Log
DECLARE FUNCTION Get_Status, Set_Printer, obj_WO_Mat

$INSERT WO_MAT_EQUATES


OPEN 'WO_MAT' TO WOMatTable ELSE
	DEBUG 
	GOTO Bail
END

OPEN 'DICT.WO_MAT' TO DictVar ELSE
	DEBUG
	GOTO Bail
END

DEBUG



SELECT WOMatTable

Done = 0
RecCnt = 0
FixCnt = 0

LOOP
	READNEXT WOMatKey ELSE Done = 1
UNTIL Done
		
	READ WOMatRec FROM WOMatTable,WOMatKey THEN
		RecCnt += 1
	
		QaProfile = WOMatRec<WO_MAT_MET_PROFILE$>
	
		IF QAProfile NE '' THEN
			*obj_WO_Mat_QA('Convert',WOMatKey:@RM:WOMatRec)
			IF Get_Status(errCode) THEN
				DEBUG
			END
			FixCnt += 1
			
			*Send_Info('Read: ':RecCnt:' Fixed: ':FixCnt:'   ':WOMatKey)
		END
		
		Send_Info('Read: ':RecCnt:' Fixed: ':FixCnt:'   ':WOMatKey)
	END ELSE
	
	
	END
	
REPEAT



Send_Dyn('Read: ':RecCnt:' Fixed: ':FixCnt)


GOTO Bail

Done = 0
RecCnt = 0
FixCnt = 0
LOOP
	READNEXT WOMatKEy ELSE Done = 1
UNTIL Done 
	READ WOMatRec FROM WOMatTable,WOMatKey THEN
		RecCnt += 1
		
		QaProfile = WOMatRec<WO_MAT_MET_PROFILE$>
		
		IF QAProfile NE '' THEN
			
			*obj_WO_Mat_QA('Convert',WOMatKey:@RM:WOMatRec)
			IF Get_Status(errCode) THEN
				DEBUG
			END
			FixCnt += 1
			
		END
		
		Send_Info('Read: ':RecCnt:' Fixed: ':FixCnt:'   ':WOMatKey)
	END
REPEAT

Send_Dyn('Read: ':RecCnt:' Fixed: ':FixCnt)

GOTO Bail

* * * * * * * * * * * * 

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

END
