COMPILE ROUTINE FIX_QUOTE(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE obj_Schedule,Send_Dyn,Send_Info
DECLARE FUNCTION Get_Status, Set_Printer

$INSERT QUOTE_EQU

OPEN 'QUOTE' TO FileIn THEN
	SELECT FileIn
	Done = 0
	RecCnt = 0
	LOOP
		READNEXT @ID ELSE Done = 1
	UNTIL Done
		READ QuoteRec FROM FileIn,@ID THEN
			Items		= QuoteRec<QUOTE_DETAIL$>
			SetupChgs	= QuoteRec<QUOTE_SETUP_CHARGE$>
			SRPChgs		= QuoteRec<QUOTE_SRP_CHARGE$>
			Prices		= QuoteRec<QUOTE_PRICE$>
			EPIPartNos	= QuoteRec<QUOTE_EPI_PART_NO$>
			
			IF EPIPartNos NE '' THEN
				
				EPIPartNos = ''
				FOR I = 1 TO COUNT(Items,@VM) + (Items NE '')
					BEGIN CASE
						CASE SetupChgs<1,I> NE ''
							EPIPartNos<1,I> = 'EPI':FMT(@ID,'R(0)#5'):'-MISC'
					
						CASE SRPChgs<1,I> NE ''
							EPIPartNos<1,I> = 'EPI':FMT(@ID,'R(0)#5'):'-SRP'
							
						CASE Prices<1,I> NE ''
							EPIPartNos<1,I> = 'EPI':FMT(@ID,'R(0)#5')
							
						CASE 1
							EPIPartNos<1,I> = ''
							
					END CASE
				
				NEXT I
				QuoteRec<QUOTE_EPI_PART_NO$> = EPIPartNos
				WRITE QuoteRec ON FileIn,@ID THEN
					Send_Dyn(@ID)
				END
			END
			RecCnt += 1
			Send_Info(RecCnt)
		END
	
	REPEAT
END



IF Get_Status(errCode) THEN DEBUG


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

END
