set date german
set deleted on
set device to printer
set print to a.lst
red=0

use paragon alias paragon shared new

mdat=paragon->datum

do zagracun
goto top
rb=1
ukupno=0
spor=0
do while !eof()
brd1=paragon->brdok
sif1=paragon->sifra
cen1=paragon->cena
kol1=paragon->kolicina
vred=round(cen1*kol1,2)
ukupno=ukupno+vred
spor=spor+paragon->porez
@prow()+1,0 say rb picture "999"
@prow(),4 say paragon->naziv picture "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
//999 xxxxxxxxxxxxx 999,999.99 x 999,999.99 = 999,999,999.99
@prow()+1,4 say sif1 picture "xxxxxxxxxxxxx"
@prow(),18 say kol1 picture "999,999.99"
@prow(),29 say "x"
@prow(),31 say cen1 picture "999,999.99"
@prow(),42 say "="
@prow(),44 say vred picture "999,999,999.99"

red=red+1
rb=rb+1
red=red+1
if red>14
        do krajrac
        do zagracun
endif
do while !rlock()
enddo
delete
unlock all
skip
enddo

red=16-red
@prow()+red,0 say " "
do krajrac
set print to
set device to screen
return


procedure zagracun
red=1
@prow(),0 say chr(15)
@prow(),0 say "BEL-CAR DOO Bore Prodanovica 12, Novi Sad "
@prow(),43 say "Datum:"+dtoc(mdat)
@prow()+1,0 say "************************************************************"
red=red+1
return

procedure krajrac
@prow()+2,0 say "============================================================"
@prow()+1,0 say "Racun br."
@prow(),10 say brd1 picture "99999"
@prow(),16 say "/"
@prow(),17 say mdat
@prow(),29 say "T  O  T  A  L:"
@prow(),49 say ukupno picture "999,999.99"
@prow()+1,0 say "====== P/P je ukljucen u cenu u iznosu od :"
@prow(),49 say spor picture "999,999.99"
@prow()+1,1 say "Hvala na poseti!           (Racun je punovazan i bez pecata)"
//@prow()+1,1 say "Racun izdao: "+alltrim(nazpis)
@prow()+4,0 say ""
return


