COMPILE ROUTINE FIX_CUST_PART(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
DECLARE FUNCTION Get_Status, Set_Printer

$INSERT PART_EQUATES
$INSERT CUST_PART_EQUATES
$INSERT COMPANY_EQU
$INSERT PROD_SPEC_EQU


OPEN 'CUST_PART' TO FileIn  ELSE
	DEBUG
	GOTO Bail
END

SELECT FileIn

RecCnt = 0
Done = 0
LOOP
	READNEXT CustPartKEy ELSE Done = 1
UNTIL Done
	
	READ CPRec FROM FileIn,CustPartKey THEN
	
		CustNo = CustPartKey[1,'*']
		
		Captive = XLATE('COMPANY',CustNo,COMPANY_CAPTIVE$,'X')
		
		IF Captive = 1 THEN
			CPRec<CUST_PART_WO_MIN_WFRS$> = 200
			CPRec<CUST_PART_WO_MAX_WFRS$> = 3000
		END ELSE
			CPRec<CUST_PART_WO_MIN_WFRS$> = 25
			CPRec<CUST_PART_WO_MAX_WFRS$> = 300
		END
		
		ProdSpecRec = XLATE('PROD_SPEC',CPRec<20>,'','X')
		
	
		
		CPRec<CUST_PART_SALES_NOTES$>			= ProdSpecRec<PROD_SPEC_SALES_NOTES$>
		CPRec<CUST_PART_SCHEDULING_NOTES$>		= ProdSpecRec<PROD_SPEC_SCHEDULING_NOTES$>
		CPRec<CUST_PART_SPEC_SHIP_INST$>		= ProdSpecRec<PROD_SPEC_SPEC_SHIP_INST$>
		CPRec<CUST_PART_SHIP_BAG_REQ$>			= ProdSpecRec<PROD_SPEC_SHIP_BAG_REQ$>
		CPRec<CUST_PART_SHIP_FULL_TYPE$>		= ProdSpecRec<PROD_SPEC_SHIP_FULL_TYPE$>
		CPRec<CUST_PART_SHIP_PARTIAL$>			= ProdSpecRec<PROD_SPEC_SHIP_PARTIAL$>
		CPRec<CUST_PART_SHIP_NCR_REJ$>			= ProdSpecRec<PROD_SPEC_SHIP_NCR_REJ$>
		CPRec<CUST_PART_SHIP_EMAIL_NOTIF$>		= ProdSpecRec<PROD_SPEC_SHIP_EMAIL_NOTIF$>
		
		
		
		
		WRITE CPRec ON FileIn,CustPartKey THEN
			Send_Dyn(CustPartKey: 'Min ':CPRec<CUST_PART_WO_MIN_WFRS$>:' Max: ':CPRec<CUST_PART_WO_MAX_WFRS$>)
		END
	END
	
REPEAT

GOTO Bail

* Junk Key Removal

SELECT FileIn

RecCnt = 0
Done = 0
LOOP
	READNEXT CustPartKEy ELSE Done = 1
UNTIL Done
	
	IF INDEX(CustPartKey,@VM,1) OR INDEX(CustPartKey,@FM,1) OR INDEX(CustPartKey,@SVM,1) THEN
		READ Pooch FROM FileIn,CustPartKey THEN
		
			PartNo = Pooch<CUST_PART_PART_NO$>
			DELETE FileIn,CustPartKey THEN
				Send_Dyn(CustPartKey)
			END
		END
	END
REPEAT

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



END
