PARAMETERS pcbill_no

PRIVATE lcbill_no,lccurrepoalias
lccurrepoalias = ALIAS()
lcbill_no = pcbill_no
do set_menu
=get_pdt('FORM 403 FOR PURCHASE VEHICLE')
SELECT pur_mast.bill_no,pur_mast.bill_dt,pur_mast.bill_amt,pur_mast.inward_no,pur_mast.inward_dt,pur_mast.l_r_no ,;
	pur_mast.ST_RT,pur_mast.ST_AMT,pur_mast.AVAT_RT,pur_mast.AVAT_AMT,pur_mast.truck_no,ledger.account,;
	ledger.contect,ledger.add1,ledger.add2,ledger.add3,ledger.city,ledger.pin,ledger.state,ledger.custtinno,ledger.cstno,;
	ledger.phone_o,ledger.fax,pur_body.chasis_no,pur_body.key_no,pur_body.kitno,pur_body.Cylinderno,;
	pur_body.rate,pur_mast.transport,MODEL.MODEL ;
FROM pur_mast JOIN pur_body ON pur_mast.bill_no = pur_body.bill_no ;
	JOIN VEHICLE ON pur_body.Ref_no = vehicle.ref_no ;
	JOIN model ON vehicle.model_no = model.model_no ;
	JOIN LEDGER ON pur_mast.supplier_n = LEDGER.account_no;
	WHERE pur_mast.bill_no = lcbill_no ;
	INTO CURSOR query
	
SELECT QUERY

IF RECCOUNT('QUERY') > 0
	DO PRINREPO WITH 'WFORM403','','','',0,.F.
	COPY TO "WFORM403SUMMARY" TYPE XLS
		DO ALERT WITH "EXCEL FILE CREATED" + (mproj_path)
	use in query
ELSE
	DO ALERT WITH "NO RECORD FOUND FOR GIVEN CONDITION"
	use in query	
	RETURN .F.
ENDIF 	
IF ! EMPTY(lccurrepoalias)
	SELECT (lccurrepoalias)
ENDIF
do cls_menu	
	
	



		
			
			