use kasa alias kasa
goto top

set device to printer
set print to c.txt
@prow(),0 say '<?xml version="1.0" standalone="no"?>'
@prow()+1,0 say '<!DOCTYPE Placanja SYSTEM "Placanja.dtd">'
@prow()+1,0 say '<Placanja>'

if kasa->ncena>0
@prow()+1,0 say '       <Vrsta kol="'+alltrim(str(kasa->ncena))+'"'+'>1</Vrsta>'
endif
if kasa->npcena>0
@prow()+1,0 say '       <Vrsta kol="'+alltrim(str(kasa->npcena))+'"'+'>2</Vrsta>'
endif
if kasa->porez>0
@prow()+1,0 say '       <Vrsta kol="'+alltrim(str(kasa->porez))+'"'+'>3</Vrsta>'
endif
@prow()+1,0 say '</Placanja>'
set print to
set device to screen
copy file c.txt to c:\FISCTT\placanja.xml

set device to printer
set print to d.txt
        eject
set print to
set device to screen


set device to printer
set print to a.txt
select kasa
goto top
@prow(),0 say '<?xml version="1.0" standalone="no"?>'
@prow()+1,0 say '<!DOCTYPE Artikli SYSTEM "Artikli.dtd">'
@prow()+1,0 say '<Artikli>'

select kasa
goto top
do while !eof()
msif=alltrim(kasa->sifrob)
mnaz=SUBSTR((alltrim(kasa->sifrob)+ALLTRIM(kasa->naziv)),1,12)
cena=kasa->pcena
pstopa="3"
ode="0"
mjm="0"

mslog1='        <Plu Des="'+mnaz+'"'
mslog2=' Price="'+alltrim(str(cena,9,2))+'"'
mslog3=' Vat="'+pstopa+'"'
mslog4=' Dep="'+ode+'"'
mslog5=' Mes="'+mjm+'"'
mslog6='>'+msif+'</Plu>'
@prow()+1,0 say  mslog1+mslog2+mslog3+mslog4+mslog5+mslog6
select kasa
skip
enddo
@prow()+1,0 say '</Artikli>'
set print to
set device to screen
copy FILe a.txt to c:\FISCTT\artikli.xml

set device to printer
set print to d.txt
        eject
set print to
set device to screen


set device to printer
set print to b.txt
@prow(),0 say '<?xml version="1.0" standalone="no"?>'
@prow()+1,0 say '<!DOCTYPE ArtRacun SYSTEM "ArtRacun.dtd">'
@prow()+1,0 say '<ArtRacun>'

select kasa
goto top
do while !eof()
mkol=round(kasa->kolicina,1)
msifra=alltrim(kasa->sifrob)
mslog1='        <Plu kol="'+alltrim(str(mkol,5,1))+'"'
mslog2='>'+msifra+'</Plu>'
@prow()+1,0 say mslog1+mslog2
skip

enddo
@prow()+1,0 say '</ArtRacun>'
set print to
set device to screen
copy FILE b.txt TO c:\FISCTT\artracun.xml

set device to printer
set print to d.txt
        eject
set print to
set device to screen



return

