wait wind 'If required.. Change Godown No'
private lcpath
CLOS DATA
set dele on
set date brit
set excl off
set cent on
clea
lcpath = ' '
@ 10,10 say 'Path Name : ' get lcpath size 1,30
read
lcpath = allt(lcpath)
use (lcpath) + 'JOB_MAST' ORDE JOBCARD_NO in 0
use (lcpath) + 'JOB_BODY' ORDE JOBCARD_NO in 0
use (lcpath) + 'ISSUE' ORDE JOBCARD_NO in 0
use (lcpath) + 'ISSUE' again ORDE issue_NO in 0 alia tmpissue
use (lcpath) + 'ISSUEBOD' in 0
use (lcpath) + 'ITEMMAST' ORDE ITEM_NO in 0 
sele JOB_mast
SET RELA TO jobcard_no into issue
scan for empt(issue.jobcard_no)
	lcissue_no = ' ' 
	lcjobcard_no = job_mast.jobcard_no
	sele tmpissue
	go bott
	lcissue_no = padl(ltrim(str(val(issue_no) + 1)),len(tmpissue.issue_no),'0')
	inse into issue ;
		(issue_no,issue_dt,jobcard_no,godown_no) ;
	values ;
		(lcissue_no,job_mast.job_dt,job_mast.jobcard_no,'01')
	sele job_body
	scan for jobcard_no = lcjobcard_no and (! empt(spare_rt) or ! empt(oil_rt))
		= seek(item_no,'ITEMMAST')
		inse into issuebod ;
			(issue_no,item_no,spare_rt,qty) ;
		values ;
			(lcissue_no,job_body.item_no,itemmast.salerate,job_body.qty)
	ends
	sele job_mast
ends