PARAMETERS pcclient_no

PRIVATE lcalias,lnClient_rec,ldCovernoteDt,lccovernotno
lcalias = ALIAS()
lccovernotno = ' '
IF ! SEEK(pcclient_no,'SALEMAST','CLIENT_NO')
	DO ERR_MSG WITH 'BILL HAS NOT BEEN PREPARED FOR THIS CUSTOMER' + CHR(13) + 'COVER NOTE CAN NOT BE PRINTED'
	RETURN 	
ENDIF 
IF EMPTY(SALEMAST.INS_CO)
	DO ERR_MSG WITH 'INSURANCE COMPANY DETAIL NOT FOUND FOR BILL NO. : ' + SALEMAST.BILL_NO + CHR(13) + 'COVER NOTE CAN NOT BE PRINTED'
	RETURN
ENDIF 
IF EMPTY(client.COVRNOTNO)
	lnClient_rec = RECNO('CLIENT')
	SET ORDER TO COVRNOTNO IN CLIENT DESCENDING 
	GO TOP IN client 
	lccovernotno = PADL(ALLTRIM(STR(VAL(client.COVRNOTNO) + 1)),LEN(client.COVRNOTNO),'0')
	PRIVATE lctmp_wind      && ,lcins_company,lcins_co,lcfrm_no,lcto_no
	lctmp_wind = SYS(2015)
	DEFINE WINDOW (lctmp_wind) FROM 0,0 TO 15,70
	ACTIVATE WINDOW (lctmp_wind)
	MOVE WINDOW (lctmp_wind) cent
	@ 2,2 say 'COVER NOTE NO : ' GET lccovernotno 
	READ 
	RELEASE WINDOWS (lctmp_wind)
	SET ORDER TO COVRNOTNO ASCENDING IN CLIENT
	SET ORDER TO CLIENT_NO IN CLIENT
ELSE 
	DO ALERT WITH 'COVER NOTE NO. IS : ' + client.COVRNOTNO
ENDIF
= get_pnam('COVER NOTE PRINTING')
DO PRINREPO WITH '','COVERNOT','','',1
IF ! EMPTY(lccovernotno)
	IF SEEK(pcclient_no,'CLIENT','CLIENT_NO')
		REPLACE client.COVRNOTNO WITH lccovernotno
	ENDIF
ENDIF 
** To be Modified as per user's requirement

