ABAZA
ABAZA
************abaza.prg*****************
****formimi i datotekes se komintenteve
**************************************
parameters pw
if pcount()=0
pw=0
endif
close all
@0,0 clear
vitia="vitivij.mem"
vak=year(date())
if ! file(vitia)
save all like va? to (vitia)
endif
restore from (vitia) additive
@20,1 say "viti vijues " get vak pict "9999"
read
save all like va? to (vitia)
rrug=disku+":\"+curdir() &&direktoriumi thirres
viti=vak-2000
vitip=viti-1
vitia=viti+1
vitic=strzero(viti,2)
vitipc=strzero(vitip,2)
vitiac=strzero(vitia,2)
rrug1=rrug+"\"+vitic+"\" &&direktoriumi viti aktual
rrug1p=rrug+"\"+vitipc+"\" &&direktoriumi viti paraprak
rrug1a=rrug+"\"+vitiac+"\" &&direktoriumi viti ardhshem
if ! isdir(rrug+"\"+vitic)
kkd="md "+vitic
! (kkd)
endif
set color to &color2
@24,0 say "*******************"
set color to &color
use
***************************
****formimi i datotekes se urdhereses
**************************************
urdh=rrug1+"urdh.dbf"
tone(555,11)
declare A1[19],A2[19],A3[19],A4[19]
create punuesp
for i=1 to 18
A1[i]="dp"+strzero(i,2)
A2[i]="N"
A3[i]=10
A4[i]=0
next i
store "C" to
A2[2],A2[3],A2[7],A2[8],A2[11],A2[12],A2[13],A2[16],A2[17],A2[18]
store "D" to A2[14]
store 8 to A3[14] &&dt.ft
store 4 to A3[1],A3[3]
store 30 to A3[2],A3[11] && artikulli ; bleresi
store 10 to A3[4] && sasia
store 13 to A3[5] && qmimi
store 15 to A3[6],A3[15] && vlera, rabati
store 1 to A3[7] && me tatim P/J
store 3 to A3[8] && tarifa
store 5 to A3[9],A3[10] && % tatimi; % hekurudha
store 15 to A3[12] && selia
store 20 to A3[13] && adresa
store 10 to A3[16],A3[17],A3[18] && nr fiskal,ID tvsh, NRB
store 3 to A4[4],A4[5]
store 2 to A4[6],A4[9],A4[10],A4[15]
for i=1 to 18
append blank
replace field_name with A1[i]
replace field_type with A2[i]
replace field_len with A3[i]
replace field_dec with A4[i]
next i
create (urdh) from punuesp
use
delete file("punuesp.dbf")
release A1[19],A2[19],A3[19],A4[19]
***********************************************
****formimi i datotekes regjistrimit
***********************************************
regj0=rrug1+"regj0.dbf"
tone(427,3)
declare a1[10],a2[10],a3[10],a4[10]
create punuesh
for i=1 to 5
a1[i]="u"+strzero(i,2)
a2[i]="C"
a3[i]=12
a4[i]=0
next i
store "N" to a2[1],a2[3],a2[4],a2[5]
store 4 to a3[1] &&NR
store 30 to a3[2] &&artikulli
store 11 to a3[3] && sasia
store 11 to a3[4] && qmimi
store 12 to a3[5] && vlera
store 3 to a4[3],a4[4],a4[5] &&sasia qmimi vlera
for i=1 to 5
* @20,10 say i
append blank
replace field_name with a1[i]
replace field_type with a2[i]
replace field_len with a3[i]
replace field_dec with a4[i]
next i
create (regj0) from punuesh
use
delete file("punuesh.dbf")
release a1[10],a2[10],a3[10],a4[10]
use
*******************************
***********************************************
****formimi i datotekes karteles
**************************************
karta=rrug1+"karta.dbf"
tone(427,3)
declare a1[10],a2[10],a3[10],a4[10]
create punuesh
for i=1 to 10
a1[i]="u"+strzero(i,2)
a2[i]="C"
a3[i]=12
a4[i]=0
next i
store "N" to a2[1],a2[4],a2[5],a2[6],a2[8],a2[9]
store "D" to a2[2]
store 4 to a3[1] &&NR
store 8 to a3[2] &&dt
store 20 to a3[3] &&dokumenti
store 11 to a3[4] && debi
store 11 to a3[5] && kredi
store 11 to a3[6] && saldo
store 20 to a3[7] && libri ku esht dokumenti
store 5 to a3[8] && nr regj. ne liber
store 4 to a3[9] && nr komi
store 20 to a3[10] && komitenti
store 2 to a4[4],a4[5],a4[6] &&debi-kredi,saldo
for i=1 to 10
* @20,10 say i
append blank
replace field_name with a1[i]
replace field_type with a2[i]
replace field_len with a3[i]
replace field_dec with a4[i]
next i
create (karta) from punuesh
use
delete file("punuesh.dbf")
release a1[10],a2[10],a3[10],a4[10]
use
*******************************
***********************************************
dit0=rrug1+"dit0.dbf"
sal0=rrug1+"sal0.dbf"
**************************************
****formimi i datotekes ditarit
**************************************
tone(427,3)
declare a1[10],a2[10],a3[10],a4[10]
create punuesh
for i=1 to 10
a1[i]="u"+strzero(i,2)
a2[i]="C"
a3[i]=12
a4[i]=0
next i
store "N" to a2[2],a2[5],a2[6],a2[7],a2[8],a2[9]
store "D" to a2[1]
store 8 to a3[1] &&dt ditarit
store 12 to a3[5],a3[6] &&hyrje ;dalje
store 12 to a3[7] && saldo
store 5 to a3[2] && nr rendor
store 9 to a3[8] && nr ditarit
store 5 to a3[3] && nr dokumentit
store 20 to a3[4] && dokumentit
store 5 to a3[9] && SHIFRA KOMITENTIT OSE KONTO
store 30 to a3[10] && KOMITENTI OSE KONTO
store 2 to a4[5],a4[6],a4[7] &&debi-kredi
for i=1 to 10
* @20,10 say i
append blank
replace field_name with a1[i]
replace field_type with a2[i]
replace field_len with a3[i]
replace field_dec with a4[i]
next i
create (dit0) from punuesh
use
delete file("punuesh.dbf")
release a1[10],a2[10],a3[10],a4[10]
use
*******************************
**************************************
****formimi i datotekes se saldove ditore te ditarit
**************************************
sal0=rrug1+"sal0.dbf"
tone(427,3)
declare a1[5],a2[5],a3[5],a4[5]
create punuesh
for i=1 to 5
a1[i]="u"+strzero(i,2)
a2[i]="N"
a3[i]=12
a4[i]=0
next i
store "N" to a2[2],a2[3],a2[4]
store "D" to a2[1]
store 8 to a3[1] &&dt ditarit
store 12 to a3[2],a3[3] &&hyrje ;dalje
store 13 to a3[4] && saldo
store 4 to a3[5] && nr rendor; nr ditarit
store 2 to a4[2],a4[3],a4[4] &&debi-kredi
for i=1 to 5
* @20,10 say i
append blank
replace field_name with a1[i]
replace field_type with a2[i]
replace field_len with a3[i]
replace field_dec with a4[i]
next i
create (sal0) from punuesh
use
delete file("punuesh.dbf")
release a1[5],a2[5],a3[5],a4[5]
use
******************
lba0=rrug1+"lba0.dbf"
sab0=rrug1+"sab0.dbf"
**************************************
****formimi i libri bankes
**************************************
tone(427,3)
declare a1[12],a2[12],a3[12],a4[12]
create punuesh
for i=1 to 12
a1[i]="u"+strzero(i,2)
a2[i]="C"
a3[i]=12
a4[i]=0
next i
store "N" to a2[2],a2[5],a2[6],a2[7],a2[8],a2[9],a2[11]
store "D" to a2[1]
store 8 to a3[1] &&dt ditarit
store 12 to a3[5],a3[6] &&hyrje ;dalje
store 12 to a3[7] && saldo
store 5 to a3[2] && nr rendor
store 9 to a3[8] && nr ditarit
store 5 to a3[3] && nr dokumentit
store 20 to a3[4] && dokumentit
store 5 to a3[9] && SHIFRA KOMITENTIT OSE KONTO
store 20 to a3[10] && KOMITENTI
store 2 to a3[11] && SHIFRA e bankes
store 10 to a3[12] && emertimi bankes
store 2 to a4[5],a4[6],a4[7] &&debi-kredi
for i=1 to 12
* @20,10 say i
append blank
replace field_name with a1[i]
replace field_type with a2[i]
replace field_len with a3[i]
replace field_dec with a4[i]
next i
create (lba0) from punuesh
use
delete file("punuesh.dbf")
release a1[12],a2[12],a3[12],a4[12]
use
*******************************
**************************************
****formimi i datotekes se saldove ditore te ditarit
**************************************
sab0=rrug1+"sab0.dbf"
tone(427,3)
declare a1[6],a2[6],a3[6],a4[6]
create punuesh
for i=1 to 6
a1[i]="u"+strzero(i,2)
a2[i]="C"
a3[i]=12
a4[i]=0
next i
store "N" to a2[2],a2[3],a2[4]
store "D" to a2[1]
store 8 to a3[1] &&dt ditarit
store 12 to a3[2],a3[3] &&hyrje ;dalje
store 13 to a3[4] && saldo
store 4 to a3[5] && nr rendor; nr bakes
store 10 to a3[6] && emri bakes
store 2 to a4[2],a4[3],a4[4] &&debi-kredi
for i=1 to 6
* @20,10 say i
append blank
replace field_name with a1[i]
replace field_type with a2[i]
replace field_len with a3[i]
replace field_dec with a4[i]
next i
create (sab0) from punuesh
use
delete file("punuesh.dbf")
release a1[6],a2[6],a3[6],a4[6]
use
******************
komi0=rrug1+"komi0.dbf"
declare A1[8],A2[8],A3[8],A4[8]
create punuesh
for i=1 to 8
A1[i]="km"+strzero(i,2)
A2[i]="C"
A3[i]=15
A4[i]=0
next i
store "N" to A2[1]
store 5 to A3[1] &&shifra-partia
store 30 to A3[2] &&emertimi i komintentit
store 15 to A3[3] &&komuna
store 20 to A3[4] &&adresa
store 10 to A3[5] &&nr.fiskal
store 10 to A3[6] &&id tvsh
store 10 to A3[7] &&nrb
for i=1 to 8
append blank
replace field_name with A1[i]
replace field_type with A2[i]
replace field_len with A3[i]
replace field_dec with A4[i]
next i
create (komi0) from punuesh
use
delete file("punuesh.dbf")
release A1[8],A2[8],A3[8],A4[8]
*****************************
****formimi i datotekes se tatimeve (tatimet.dbf)
**************************************
tatimet=rrug1+"tatimet.dbf"
itatimet=rrug1+"itatimet.ntx"
if ! file(tatimet)
declare A1[6],A2[6],A3[6],A4[6]
create punues3
A1[1]="nr"
A1[2]="emri"
A1[3]="federativ"
A1[4]="republikan"
A1[5]="komunal"
A1[6]="pershkrimi"
store "C" to A2[1],A2[2],A2[6]
store "N" to A2[3],A2[4],A2[5]
store 15 to A3[2]
store 200 to A3[6]
store 3 to A3[1]
store 5 to A3[3],A3[4],A3[5]
store 0 to A4[1],A4[2],A4[6]
store 0 to A4[3],A4[4],A4[5]
for i=1 to 6
@24,60 say i
append blank
replace field_name with A1[i]
replace field_type with A2[i]
replace field_len with A3[i]
replace field_dec with A4[i]
next i
create (tatimet) from punues3
index on nr to (itatimet)
use
delete file("punues3.dbf")
release A1[6],A2[6],A3[6],A4[6]
endif
use
***************************
meb=rrug1+"meb.dbf"
meb1=rrug1+"meb1.ntx"
meb2=rrug1+"meb2.ntx"
if ! file(meb)
declare A1[6],A2[6],A3[6],A4[6]
create punuesp
for i=1 to 6
A1[i]="ko"+strzero(i,2)
A2[i]="C"
A3[i]=15
A4[i]=0
next i
store "N" to A2[1],A2[4],A2[5],A2[6]
store 2 to A3[1] &&nr bankes
store 10 to A3[2] &&emertimi bankes
store 20 to A3[3] &&xhirllog
store 13 to A3[4] &&debi
store 13 to A3[5] &&krebi
store 13 to A3[6] &&saldo
store 2 to A4[4],A4[5],A4[6]
for i=1 to 6
append blank
replace field_name with A1[i]
replace field_type with A2[i]
replace field_len with A3[i]
replace field_dec with A4[i]
next i
create (meb) from punuesp
use
delete file("punuesp.dbf")
release A1[6],A2[6],A3[6],A4[6]
endif
use (meb)
************ komitentet*********************
komi0=rrug1+"komi0.dbf"
select 1
use (komi0)
zap
komi=rrug1+"komi"+strzero(i1,2)+".dbf"
if ! file(komi)
copy to (komi)
else
append from(komi) all
copy to (komi)
endif
komi1=rrug1+"komi1"+strzero(i1,2)+".ntx"
komi2=rrug1+"komi2"+strzero(i1,2)+".ntx"
select 1
use
if ! netuse(komi,.t.,10)
return
endif
index on km01 to (komi1)
index on km02 to (komi2)
use
************* tatimet *******************
@22,0 clear
tatimet=rrug1+"tatimet.dbf"
itatimet=rrug1+"itatimet.ntx"
select 1
use
if ! netuse(tatimet,.t.,10)
return
endif
index on nr to (itatimet)
use
**************************************
edepo=rrug1+"edepo.dbf"
edepo1=rrug1+"edepo1.ntx"
if ! netuse(edepo,.t.,10)
return
endif
index on edp1 to (edepo1)
use
********* libri shitjes****************
ltvsh=rrug1+"tvsh"+strzero(i1,2)+".dbf"
lsh2=rrug1+"lsh2"+strzero(i1,2)+".ntx"
lsh1=rrug1+"lsh1"+strzero(i1,2)+".ntx"
lsh15=rrug1+"lsh15"+strzero(i1,2)+".ntx"
select 1
use(otvsh)
zap;use
if ! file(ltvsh)
copy file (otvsh) to (ltvsh)
else
select 1
if ! netuse(otvsh,.t.,10)
return
endif
append from(ltvsh) all
delete file(ltvsh)
copy to (ltvsh)
endif
select 1
use
if ! netuse(ltvsh,.t.,10)
return
endif
index on pk01 to (lsh1)
index on pk02 to (lsh2)
index on pk15 to (lsh15)
************libri blerjes *****************************
ltvb=rrug1+"tvb"+strzero(i1,2)+".dbf"
lb1=rrug1+"lb1"+strzero(i1,2)+".ntx"
lb2=rrug1+"lb2"+strzero(i1,2)+".ntx"
lb15=rrug1+"lb15"+strzero(i1,2)+".ntx"
otvsh=rrug1+"otvsh.dbf"
select 1
use(otvsh)
zap;use
if ! file(ltvb)
copy file (otvsh) to (ltvb)
else
select 1
if ! netuse(otvsh,.t.,10)
return
endif
append from(ltvb) all
delete file(ltvb)
copy to (ltvb)
endif
select 1
use
if ! netuse(ltvb,.t.,10)
return
endif
index on pk01 to (lb1)
index on pk02 to (lb2)
index on pk15 to (lb15)
********************************************
use
@24,0 clear
return
**************************************
**************************************************
procedure renditja
kk1=1
use (ditar)
index on u09 to (ditar9)
index on u01 to (ditar1)
set index to (ditar1),(ditar9)
go top
au01=u01;au08:=1;au02:=0
do while ! eof()
if au01#u01
au02=1
au01=u01
au08=au08+1
else
au02=au02+1
endif
replace u02 with au02,u08 with au08
skip
enddo
return
*******************
##############################################################################