PROCEDURE prinrecp

IF BOF() OR EOF()
	DO err_beep
	DO alert WITH '!!! ERROR !!!;No receipt found for printing;;Pressed key has no menaning here'
	RETU
ENDIF

DO ALERT WITH "Enter Receipt"

PRIVATE lnrecpt_rec,lcalias,lcrepnam
lcalias = ALIAS()
lnrecpt_rec = RECN('RECEIPT')
= get_pnam('Receipt Printing')
SELE receipt
lnamt_recvd = getrecpt(receipt.client_no)
GO lnrecpt_rec IN receipt
IF SEEK(ALLTRIM(client.modelcolno),'MODELCOL','MODELCOLNO')
	IF SEEK(MODELCOL.MODEL_NO,'MODEL','MODEL_NO')
	ENDIF 
ENDIF
IF SEEK(client.client_no,'SALEMAST','CLIENT_NO')
ENDIF

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

IF ';' $ gcsrname
	DEFINE wind  get_recpt from 0,0 to 6,70 pane
	ACTIVATE wind get_recpt 
	MOVE wind  get_recpt cent
	@ 2,2 say 'Invoice File : ' 

	lcrepnam = subs(gcsrname,1,at(';',gcsrname) - 1)
	@ 1,20 get lcrepnam pict '@^ ' + allt(gcsrname) size 3,14
	READ 
	RELEASE wind get_recpt
ELSE 
	lcrepnam = allt(gcsrname)
ENDIF

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

IF EMPTY(gcsrname)
	DO prinrepo WITH 'wsalesreceipt','recept_1','','',1
ELSE
	DO prinrepo WITH (lcrepnam),(lcrepnam),'','',1
ENDIF
GO (lnrecpt_rec) IN receipt
IF ! EMPTY(lcalias)
	SELECT (lcalias)
ENDIF
*DO out_repo WITH .T.,'RECEIPT PRINTING;80'