*EDITION DES REGIES
TITRE =" JOURNAL DE SORTIE REGIE"
dimension tab[29,4]
tab[1,1]=10
tab[2,1]=22
tab[3,1]=34
tab[4,1]=46
tab[5,1]=58
tab[6,1]=70
tab[7,1]=82
tab[8,1]=94
tab[9,1]=106
tab[10,1]=118
tab[11,1]=130
tab[12,1]=142
tab[13,1]=154
tab[14,1]=166
tab[15,1]=10
tab[16,1]=22
tab[17,1]=34
tab[18,1]=46
tab[19,1]=58
tab[20,1]=70
tab[21,1]=82
tab[22,1]=94
tab[23,1]=106
tab[24,1]=118
tab[25,1]=130
tab[26,1]=142
tab[27,1]=153
tab[28,1]=166
for c=1 to 28
tab [c,2]=0.00
tab [c,3]=0.00
tab[c,4]=" "
vtotfac=0
next c
sele 1
use bglireg index bglirad alias liv
*index on radical to temp
go top
vtab=1
do while .not. eof()
tab[tabul,4]=trim(radical)
skip
enddo
Blanc="               "
go bott
date2=liv->date
go top
date1=liv->date
mois1=cmonth(date1)
mois2=cmonth(date2)
mois=mois1
************
pol1=CHR(27)+"&l1O"+chr(27)+"(s12U"+chr(27)+"(s0P"+chr(27)+"(s12H"+chr(27)+"(s12V"+chr(27)+"(s0S"+chr(27)+"(s0B"+chr(27)+"(s3T"
pol2=CHR(27)+"&l1O"+chr(27)+"&l8D"+chr(27)+"(s12U"+chr(27)+"(s0P"+chr(27)+"(s16H"+chr(27)+"(s10V"+chr(27)+"(s0S"+chr(27)+"(s0B"+chr(27)+"(s3T"
pol3=CHR(27)+"&l1O"+chr(27)+"(s12U"+chr(27)+"(s1P"+chr(27)+"(s5H"+chr(27)+"(s24V"+chr(27)+"(s0S"+chr(27)+"(s0B"+chr(27)+"(s6T"
vtotfac=0000.00
vtotmois=0
set print off
go top
vimp=0
set print on
? chr(27)+"&l1O"+chr(27)+"&l26A"
? pol2
eject
do wHIle .not. eof()
if mois=mois2
set print on
vimp=1
set margin to 0
endi
vnumf=liV->numfact
if prow()<2.and.vimp=1
? pol3+"JOURNAL DE REGIE ANNEE "+str(year(liv->date),4)+" mois de "+mois+" "+societe
?
? pol2 +"  fact   "
for c=1 to 14
??"  "+tab[c,4]+left(blanc,10-len(tab[c,4]))
next c
?
?
*vt=ltrim(str(tab[13,1]))
endi
*+"&a152C"+dtoc(liv->date)
if vimp=1
?? str(liv->numfact,4,0)
endi
do while liv->numfact=vnumf
vt=ltrim(str(tab[liv->tabul,1]))
vi=liv->tabul
if vi<15 .and. vimp=1
??chr(27)+"&a"+vt+"C"+" "+str(liv->total,7,2)
tab[vi,2]=tab[vi,2]+liv->total
endi
tab[vi,3]=tab[vi,3]+liv->total
*vtotfac=vtotfac+liv->total
*vtotmois=vtotmois+liv->total
*tab[28,3]=tab[28,3]+liv->total
*tab[28,2]=tab[28,2]+liv->total
skip
enddo
mois=cmonth(liv->date)
if vimp=1
for vtb=1 to 14
vt=ltrim(str(tab[vtb,1]-3))
?? chr(27)+"&a"+vt+"C³"
next vtb
*??chr(27)+"&a166C"+str(vtotfac,8,2)
?"-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
?
vtotfac=0
if prow()>53 .or. mois<>mois2
*impression des totaux colonne
for c=1 to 14
vt=ltrim(str(tab[c,1]))
??chr(27)+"&a"+vt+"C"+str(tab[c,2],8,2)
tab[c,2]=0
next C
for vtb=1 to 14
vt=ltrim(str(tab[vtb,1]-3))
?? chr(27)+"&a"+vt+"C³"
next vtb
? " "
for c=1 to 14
vt=ltrim(str(tab[c,1]))
??chr(27)+"&a"+vt+"C"+str(tab[c,3],8,2)
next C
? " "
eject
endi
mois1=mois
endi
if .not.eof()
loop
else
exit
endi
enddo
*impression des totaux colonne
if vimp=1
*for c=1 to 14
*vt=ltrim(str(tab[c,1]))
*??chr(27)+"&a"+vt+"C"+str(tab[c,2],8,2)
*tab[c,2]=0
*next C
*for vtb=1 to 14
*vt=ltrim(str(tab[vtb,1]-3))
*?? chr(27)+"&a"+vt+"C³"
*next vtb
*? " "
*?
*for c=1 to 14
*vt=ltrim(str(tab[c,1]))
*??chr(27)+"&a"+vt+"C"+str(tab[c,3],8,2)
*next C
*? " "
*?
*eject
*endi
***************************************pages 2

blanc="               "
vtotfac=0
mois1=cmonth(date1)
mois2=cmonth(date2)
mois=mois1
go top
vimp=0
do wHIle .not. eof()
if mois=mois2
set print on
vimp=1
set margin to 0
endi
vnumf=liV->numfact
set print off
? vnumf
set print on
if prow()<2.and.vimp=1
*?pol2
? pol3+"JOURNAL DE REGIE ANNEE "+str(year(liv->date),4)+" mois de "+mois+" "+societe
?
? pol2 +"  fact   "
for c=15 to 26
??"  "+tab[c,4]+left(blanc,10-len(tab[c,4]))
next c
??"    date      total"
?
?
*vt=ltrim(str(tab[13,1]))
endi
if vimp=1
?? str(vnumf,4,0)+chr(27)+"&a152C"+dtoc(liv->date)
endi
do while liv->numfact=vnumf
vt=ltrim(str(tab[liv->tabul,1]))
vi=liv->tabul
if vimp=1                          
vtotfac=vtotfac+liv->total
tab[28,2]=tab[28,2]+liv->total
 if vi>14
 ??chr(27)+"&a"+vt+"C"+" "+str(liv->total,7,2)
 endi
endi
tab[vi,3]=tab[vi,3]+liv->total
tab[vi,2]=tab[vi,2]+liv->total
vtotmois=vtotmois+liv->total
tab[28,3]=tab[28,3]+liv->total
skip
enddo
mois=cmonth(liv->date)
if vimp=1
for vtb=15 to 28
vt=ltrim(str(tab[vtb,1]-3))
?? chr(27)+"&a"+vt+"C³"
next vtb
??chr(27)+"&a166C"+str(vtotfac,8,2)
?"-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
?
vtotfac=0
if prow()>53 .or. mois<>mois2
*impression des totaux colonne
for c=15to 28
vt=ltrim(str(tab[c,1]))
??chr(27)+"&a"+vt+"C"+str(tab[c,2],8,2)
tab[c,2]=0
next C
for vtb=15to 28
vt=ltrim(str(tab[vtb,1]-3))
?? chr(27)+"&a"+vt+"C³"
next vtb
? " "
for c=15to 28
vt=ltrim(str(tab[c,1]))
??chr(27)+"&a"+vt+"C"+str(tab[c,3],8,2)
next C
? " "
? "                                                  "
eject
endi
mois1=mois
endi
if .not.eof()
loop
else
exit
endi
enddo
*impression des totaux colonne
*for c=15to 28
*vt=ltrim(str(tab[c,1]))
*??chr(27)+"&a"+vt+"C"+str(tab[c,2],8,2)
*tab[c,2]=0
*next C
*for vtb=15to 28
*vt=ltrim(str(tab[vtb,1]-3))
*?? chr(27)+"&a"+vt+"C³"
*next vtb
*? " "
*?
*for c=15to 28
*vt=ltrim(str(tab[c,1]))
*??chr(27)+"&a"+vt+"C"+str(tab[c,3],8,2)
*next C
*? " "
*?
*eject
set print off
do pol
close data
retu
