Wiki Home

meterreport Ofcloth


Namespace: VFP
*: Program:[METER REPORT OF CLOTH ITEM]
*:Created by:Khetaram
gf='1'
ptype=1
stype=1
*
prd='FOR THE PERIOD FROM '+dtoc(date1)+ 'To '+dtoc(date2)
kg1=0.00
pshrt=2.5
@14,22 say '1 kg. fent in Meter ' get kg1 pict '99.999'
@15,22 say 'ENTER SHORTAGE in % ' get pshrt pict '99.999'
read
if readkey()=12
retu
endif
@ 16,30 prom 'GROSS METER'
@ 16,45 prom 'NET METER '
menu to yn2
@ 17,30 prom 'DATEWISE '
@ 17,45 prom 'MONTHWISE '
menu to yn1
hdng='METER REPORT OF CLOTH ITEM '+prd
dash=iif(prnt,chr(27)+chr(77)+d156,d80)
stor 0 to tmtr2,tmtr6g,tmtr6f,tmtrk2,tqtyk2,tshort,tprmtr,tsrmtr
stor 0 to mtr6g,mtr6f,mtr2,qtyk2,mtrk2,short,gmtr2
stor 0 to tmtr2,tmtr6g,tmtr6f,tgmtr2,ln,pg
sele 6
go top
do whil date if yn2=1
nmtr = mtr
else
nmtr=iif (fold#0,mtr*fold*.01,mtr)
endif
if gf='1'
tmtr6g=tmtr6g+iif(ptype=1,nmtr,0-nmtr)
else
tmtr6f=tmtr6f+iif(ptype=1,nmtr,0-nmtr)
endif
skip
enddo
flag6=iif(date>date2 .or. eof(),.n.,.y.)
sele 2
go top
do whil date tmtr2=tmtr2+iif(stype<4,mtr,0-mtr)
skip
enddo
flag2=iif(date>date2 .or. eof(),.n.,.y.)
oblmtr=tmtr6g+tmtr6f-tmtr2
@ 18,22 say 'OPENING BALANCE OF METER AS ON '+dtoc(date1)
@ 19,32 get oblmtr pict '999999999.99'
read
stor 0 to tmtr6g,tmtr6f,tmtr2
fld=iif(yn1=1,'date=dt1','mont(date)=m')
do whil flag6 .or. flag2
if ln=0
do pgbegin with 132
@ln,0 say dash
if prnt
x=' DATE OP.STK <---------- PURCHASES ---------> TOTAL <--------------------- SALES -----------------> SHORTAGE BALANCE'
y=' GREY FINISH METERS FRC KG. FRC MTR. GREY SALES'
@ln+1,0 say x
@ln+2,0 say y
ln=ln+3
else
@ ln+1,0 say ' DATE BAL B/F PURCHASES TOTAL'
@ ln+2,52 say ' SALES BAL C/F'
ln=ln+3
endif
@ ln+1,0 say dash
ln=ln+2
endif
stor 0 to mtr6g,mtr6f,mtr2,qtyk2,mtrk2,short,gmtr2
dt1 = iif(f->datedate,date)
m=month(date)
if flag2 .and. (.not. flag6 .or. b->date<=dt1 .or. yn1=2)
sele 2
dt1= date
m=mont(date)
do whil &fld
if stype<4
if unit='K'
qtyk2=qtyk2+qty
if stype=1
mtrk2=mtrk2+iif(kg1#0,round(qty*kg1,2),mtr)
else
gmtr2=gmtr2+iif(kg1#0,round(qty*kg1,2),mtr)
endif
else
if stype=1
mtr2=mtr2+mtr
else
gmtr2=gmtr2+mtr
endif
endif
else
tsrmtr=tsrmtr+mtr
endif
skip
enddo
if eof() .or. date>date2
flag2=.n.
endif
endif
if flag6
sele 6
m=iif(mont(date)#m,mont(date),m)
do whil &fld
if yn2=1
nmtr = mtr
else
nmtr=iif (fold#0,mtr*fold*.01,mtr)
endif
if ptype=1
if gf='1'
mtr6g=mtr6g+nmtr
else
mtr6f=mtr6f+nmtr
endif
else
tprmtr=tprmtr+nmtr
endif
skip
enddo
if eof() .or. date>date2
flag6=.n.
endif
endif
short=round((mtr2+mtrk2)*pshrt*.01,2)
if yn1=1
@ ln,0 say dt1
else
@ ln,0 say cmon(dt1)
endif
@ ln,10 say oblmtr pict '999999999.99'
if prnt
x=oblmtr+mtr6g+mtr6f
@ ln,024 say mtr6g pict '9999999999.99'
@ ln,038 say mtr6f pict '9999999999.99'
@ ln,052 say x pict '9999999999.99'
@ ln,066 say mtr2 pict '9999999999.99'
@ ln,080 say qtyk2 pict '9999999.99'
@ ln,091 say mtrk2 pict '9999999.99'
@ ln,102 say gmtr2 pict '9999999999.99'
@ ln,116 say short pict '9999999999.99'
oblmtr=oblmtr+mtr6g+mtr6f-(mtr2+mtrk2)-gmtr2-short
@ ln,130 say oblmtr pict '9999999999.99'
else
x=oblmtr+mtr6g+mtr6f
@ ln,24 say mtr6g+mtr6f pict '9999999999.99'
@ ln,38 say x pict '9999999999.99'
@ ln,52 say mtr2+mtrk2+tgmtr2 pict '999999999.99'
oblmtr=oblmtr+mtr6g+mtr6f-(mtr2+mtrk2)-gmtr2
@ ln,66 say oblmtr pict '9999999999.99'
endif
ln=ln+1
tshort=tshort+short
tmtr6g=tmtr6g+mtr6g
tmtr6f=tmtr6f+mtr6f
tmtr2=tmtr2+mtr2
tqtyk2=tqtyk2+qtyk2
tmtrk2=tmtrk2+mtrk2
tgmtr2=tgmtr2+gmtr2
if .not. flag2 .and. .not. flag6
exit
endif
do pgend with 18,50,80
if ext
exit
endif
enddo
if prnt
set devi to print
endif
@ ln,0 say dash
ln=ln+1
@ ln,0 say 'TOTALS'
if prnt
x=oblmtr+tmtr6g+tmtr6f
@ ln,024 say tmtr6g pict '9999999999.99'
@ ln,038 say tmtr6f pict '9999999999.99'
@ ln,066 say tmtr2 pict '9999999999.99'
@ ln,080 say tqtyk2 pict '9999999.99'
@ ln,091 say tmtrk2 pict '9999999.99'
@ ln,102 say tgmtr2 pict '9999999999.99'
@ ln,116 say tshort pict '9999999999.99'
else
@ ln,24 say tmtr6g+tmtr6f pict '9999999999.99'
@ ln,38 say oblmtr+mtr6g+mtr6f pict '9999999999.99'
@ ln,52 say tmtr2+tmtrk2+tgmtr2 pict '999999999.99'
@ ln,66 say oblmtr pict '9999999999.99'
endif
if ln>15 .and. .not. prnt
ln=15
do wt1 with ''
@ ln,0 clea
endif
@ ln+1,0 say dash
@ ln+2,0 say ' BALANCE :'+str(oblmtr,12,2)
if prnt
@ ln+2,40 say 'TOTAL TRADING SALES METER : '+str(tmtr2+tmtrk2+tshort,12,2)
endif
@ ln+3,0 say ' Add SALES RETURN :'+str(tsrmtr,12,2)
@ ln+4,0 say 'Less PURCHASE RETURN :'+str(tprmtr,12,2)
nbal=oblmtr+tsrmtr-tprmtr
@ ln+5,0 say ' NET BALANCE :'+str(nbal,12,2)
if .not. prnt
@ ln,52 say tmtr2+tmtrk2+tgmtr2 pict '999999999.99'
@ ln+1,0 say dash
endif
do rptend
sele 2
retu
*: End Of File
( Topic last updated: 2017.08.12 11:39:08 PM )