do set_menu
= get_pdt('MOTORCYCLE TECHNICAL REPORT (UNDER WARRANTY)')
do wait_msg
wait wind '!!! WAIT !!! Gathering Data Using SQL ...' nowa
sele job_mast.client_no,job_mast.jobcard_no,issuebod.item_no,item,qty,;
	job_mast.job_dt,client.sale_dt,old_code,engine_no,chasis_no,job_mast.deli_dt,;
	modelcolno,kms,iif(job_mast.oil,'Y','N') as oil_flg,client.dealer_cod,job_mast.oil_no ;
	from job_mast,client,issue,issuebod,itemmast ;
	where betw(job_dt,date1,date2) ;
		and job_mast.jobcard_no = issue.jobcard_no ;
		and job_mast.client_no = client.client_no ;
		and issue.issue_no = issuebod.issue_no ;
		and issuebod.item_no = itemmast.item_no ;
		and WARRANTY = 'C' ;
	into cursor query ;
	orde by job_dt
if _TALLY > 0
	wait wind '!!! WAIT !!! Generating Report ...' nowa
	private kms_1,kms_2,kms_3,kms_4,kms_5,kms_6
	private date_1,date_2,date_3,date_4,date_5,date_6
	sele client
	set orde to dealer_cod in dealer
	set rela to dealer_cod into dealer
	sele modelcol
	set orde to modelcolno in modelcol
	set orde to model_no in model
	set rela to model_no into model addi
	sele query
	set rela to modelcolno into modelcol addi
	set orde to common_no in common
	set rela to jobcard_no + 'M' into common addi
	set orde to client_no in client
	set rela to client_no into client addi
	store 0 to kms_1,kms_2,kms_3,kms_4,kms_5,kms_6
	store {  /  /  } to date_1,date_2,date_3,date_4,date_5,date_6
	store ' ' to CLI_DEALER,mitem_no,MOLD_CODE,mitem
  	do prinrepo with 'WTECH_REP','TECH_REP','','',''
	set rela off into modelcol
	set rela off into common
	set rela off into client
	sele modelcol
	set rela off into modelcol
	set rela off into model
	sele modelcol
	sele client
	set rela off into dealer
*	do out_repo
else
	deac wind wait
	wait clea
	do err_beep
	do alert with '!!! ATTENTION !!!;No warranty Job Card Found Between Given Period'
endif
use in query
do cls_menu