23 Abr 2013 19:47
23 Abr 2013 22:56
25 Abr 2013 11:31
26 Abr 2013 08:59
Share_Tables = 0 - if 0 (default, this mode server was the only from the
start of a letodb project), the letodb opens all
tables in an exclusive mode, what allows to increase
the speed. If 1 (new mode, added since June 11, 2009),
tables are opened in the same mode as client
applications opens them, exclusive or shared, what
allows the letodb to work in coexistence with other
types of applications.
26 Abr 2013 11:28
17 Jun 2013 20:13
04 Jul 2013 19:59
05 Jul 2013 09:59
20 Out 2013 21:08
#include "INKEY.CH"
#include "CLUBE.CH"
FUNCTION REL_VENDPR(aPhis)
local Atel:=savescreen(00,00,24,79)
local tyAp:=type("aPhis")
ABREARQ(,{"AL_SAIDA","AL_CLIEN","AL_VENDE","AL_SAISN","AL_CIDAD","AL_PEDSN","AL_ESTOQ","AL_PEDID","AL_ITPED","AL_ITPSN","AL_GRUPO"})
do whil .t.
rest screen from aw_tel_master
SETBLINK(.F.)
WIN3D("Informe o per¡odo",04,02,06,54,2,"9")
v_dat1=CTOD(" / / ")
v_dat2=CTOD(" / / ")
@ 05,03 say "Per¡odo de = " get v_dat1 pict"@D" VALID( v_dat1 != CTOD(" / / ") )
@ 05,33 say "At‚ = " get v_dat2 pict"@D" VALID( v_dat2 != CTOD(" / / ") )
read
if (LASTKEY()==27)
SETBLINK(.T.)
ABREARQ(,.F.)
RESTSCREEN(00,00,24,79,Atel)
retu
end
a1=time()
sele AL_SAIDA
DBSETORDER(2)
ORDSCOPE(0,DTOS(v_dat1))
ORDSCOPE(1,DTOS(v_dat2))
DBGOTOP()
sele AL_SAISN
DBSETORDER(6)
ORDSCOPE(0,DTOS(v_dat1))
ORDSCOPE(1,DTOS(v_dat2))
DBGOTOP()
sele AL_SAIDA
if EOF()
MENSAGEM("Aten‡Æo, nÆo foi econtrado dados neste per¡odo !!!",3)
loop
end
WIN3D("",10,02,12,46,2,"9"); @ 11,04 say "Gerando relatorio, Aguarde ..............."
vDados:={}
vRuim:={}
sele AL_SAIDA
bQua:=bVal:=0
@ 20,01 say a1
a2=time()
@ 20,15 say a2
do whil !EOF()
if ((AL_SAIDA->tiposa#"01" .and. AL_SAIDA->tiposa#"02") .or. cancel="*")
skip
loop
end
bSeek=ncarga+codped
sele AL_ITPED
DBSEEK(bSeek)
do whil (!EOF() .and. ncarga=AL_SAIDA->ncarga .and. codped=AL_SAIDA->codped)
if condic=" "
IF ASCAN(vDados, {|a| A[1] = AL_ITPED->codite })#0
vVar=ASCAN(vDados, {|a| A[1]=AL_ITPED->codite })
sele AL_ESTOQ
DBSETORDER(1)
DBSEEK(AL_ITPED->codite)
vDados[vVar][3]=(vDados[vVar][3]+AL_ITPED->quanti)
vDados[vVar][5]=(vDados[vVar][5]+(AL_ITPED->quanti*AL_ESTOQ->pesoun))
vDados[vVar][6]=(vDados[vVar][6]+AL_ITPED->pretot)
if AL_ITPED->pretot<=0
AADD(vRuim, AL_SAIDA->ncarga+AL_SAIDA->codped)
end
else
sele AL_ESTOQ
DBSETORDER(1)
DBSEEK(AL_ITPED->codite)
AADD(vDados, {AL_ITPED->codite,AL_ESTOQ->descri,AL_ITPED->quanti,0,(AL_ITPED->quanti*AL_ESTOQ->pesoun),AL_ITPED->pretot,AL_ESTOQ->codgru})
if AL_ITPED->pretot<=0
AADD(vRuim, AL_SAIDA->ncarga+AL_SAIDA->codped)
end
end
bQua=(bQua+AL_ITPED->quanti)
bVal=(bVal+AL_ITPED->pretot)
end
sele AL_ITPED
skip
end
sele AL_SAIDA
skip
end
sele AL_SAISN
do whil !EOF()
if ((AL_SAISN->tiposa#"01" .and. AL_SAISN->tiposa#"02") .or. cancel="*")
skip
loop
end
bSeek=ncarga+codped
sele AL_ITPSN
DBSEEK(bSeek)
do whil (!EOF() .and. ncarga=AL_SAISN->ncarga .and. codped=AL_SAISN->codped)
if condic=" "
IF ASCAN(vDados, {|a| A[1] = AL_ITPSN->codite })#0
vVar=ASCAN(vDados, {|a| A[1]=AL_ITPSN->codite })
sele AL_ESTOQ
DBSETORDER(1)
DBSEEK(AL_ITPSN->codite)
vDados[vVar][4]=(vDados[vVar][4]+AL_ITPSN->quanti)
vDados[vVar][5]=(vDados[vVar][5]+(AL_ITPSN->quanti*AL_ESTOQ->pesoun))
vDados[vVar][6]=(vDados[vVar][6]+AL_ITPSN->pretot)
if AL_ITPSN->pretot<=0
AADD(vRuim, AL_SAISN->ncarga+AL_SAISN->codped)
end
else
sele AL_ESTOQ
DBSETORDER(1)
DBSEEK(AL_ITPSN->codite)
AADD(vDados, {AL_ITPSN->codite,AL_ESTOQ->descri,0,AL_ITPSN->quanti,(AL_ITPSN->quanti*AL_ESTOQ->pesoun),AL_ITPSN->pretot,AL_ESTOQ->codgru})
if AL_ITPSN->pretot<=0
AADD(vRuim, AL_SAISN->ncarga+AL_SAISN->codped)
end
end
bQua=(bQua+AL_ITPSN->quanti)
bVal=(bVal+AL_ITPSN->pretot)
end
sele AL_ITPSN
skip
end
sele AL_SAISN
skip
end
a3=time()
@ 20,30 say time()
inkey(0)
vb_texto=" Periodo de "+DTOC(v_dat1)+" Ate "+DTOC(v_dat2)
Opc_Rel(08,50,22,75,1,Date())
if (trab_nkey==17 .or. trab_nkey==27 .or. trab_nkey==4)
restscreen(00,00,24,79,Atel)
loop
elseif (trab_nkey==1)
trab_impr:='I'
set print on
set devi to print
elseif (trab_nkey==2 .or. trab_nkey==3)
trab_impr:='V'; v_arqt=iif(trab_nkey==2,'.\textos\spool.prn',GERAREL())
set print to &v_arqt
set devi to print
end
v_tot1=0.00
v_tot2=0.00
v_tot3=0.00
v_tot4=0.00
v_tot5=0.00
v_tot6=0.00
v_tot7=0.00
v_tot8=0.00
x_tot1=0.00
x_tot2=0.00
x_tot3=0.00
x_tot4=0.00
x_tot5=0.00
x_tot6=0.00
x_tot7=0.00
l=99
p=1
oDados:=ASORT(vDados,,, {|x,y| x[7]+x[2] < y[7]+y[2]} )
vTotk=0 ; vTotr=0
for i:=1 to LEN(vDados)
vTotk=(vTotk+vDados[i][5])
vTotr=(vTotr+vDados[i][6])
next
vCont=1
cCodGrupo=""
do whil (LEN(oDados)>=vCont .and. inke()!=27)
if l>=58
Cabecalho("RELATORIO DE VENDAS/PRODUTO",130,p,'chr(15)','chr(14)+chr(15)')
@ 08,01 say "|"+vb_texto
@ 08,130 say "|"
@ 09,01 say "+-------------------------------------------+------+---------------------------------------------------------+-------------------+"
@ 10,01 say "| | | A N A L I S E D O Q U A D R O V E N D A S | VALORES (R$) |"
@ 11,01 say "| | +----------+----------+------------+---------------+------+-------------+-----+"
@ 12,01 say "| NOME DO PRODUTO |CODIGO|1a. Quin. |2a. Quin. | TOTAL | TOTAL (kg) | (%) | VENDAS | (%) |"
@ 13,01 say "+-------------------------------------------+------+----------+----------+------------+---------------+------+-------------+-----+"
p++
l=14
end
if VAL(oDados[vCont][1])=0
vCont++
if LEN(oDados)<vCont .or. l>=58
@ l,01 say "+-------------------------------------------+------+----------+----------+------------+---------------+------+-------------+-----+"
@ l+1,1 say "| VALOR TOTAL ====> | |"+TRANS(v_tot1,"999999.999")+"|"+TRANS(v_tot2,"999999.999")+"|"+TRANS(v_tot1+v_tot2,"99999999.999")+"|"+TRANS(v_tot4,"999999999999.999")+"| |"+TRANS(v_tot5,"@E 99,999,999.99")+"| |"
@ l+2,1 say "+-------------------------------------------+------+----------+----------+------------+---------------+------+-------------+-----+"
@ l+3,1 say "+"+REPL("=",128)+"+"
@ l+4,1 say "+------------------------------------+"
@ l+5,1 say "| Valor dos Cortes => "+TRANS(v_tot6,"@E 999,999.99")+" |"
@ l+6,1 say "| (%) dos Cortes => "+TRANS( (v_tot6/bVal)*100,"99.99")+" |"
@ l+7,1 say "+------------------------------------+"
end
loop
end
if cCodGrupo#oDados[vCont][7]
sele AL_GRUPO
DBSETORDER(1)
DBSEEK(oDados[vCont][7])
@ l,1 say "+-------------------------------------------+------+----------+----------+------------+---------------+------+-------------+-----+"
if trab_impr="I"
@ l+1,1 say CHR(27)+"E"+"| Grupo : "+oDados[vCont][7]+" - "+AL_GRUPO->descri
@ l+1,132 say "|"+CHR(27)+"F"
else
@ l+1,1 say "| Grupo : "+oDados[vCont][7]+" - "+AL_GRUPO->descri
@ l+1,130 say "|"
end
@ l+2,1 say "+-------------------------------------------+------+----------+----------+------------+---------------+------+-------------+-----+"
l=l+3
cCodGrupo=oDados[vCont][7]
end
@ l,01 say "|"+LEFT(oDados[vCont][2],43)+"|"+LEFT(oDados[vCont][1],6)+"|"+TRANS(oDados[vCont][3],"999999.999")+"|"+TRANS(oDados[vCont][4],"999999.999")+"|"+TRANS(oDados[vCont][3]+oDados[vCont][4],"99999999.999")+"|"+TRANS(oDados[vCont][5],"99999999999.999")+"| "+;
TRANS( ((oDados[vCont][3]+oDados[vCont][4])/bQua)*100,"99.99")+"|"+TRANS(oDados[vCont][6],"@E 99,999,999.99")+"|"+TRANS( (oDados[vCont][6]/bVal)*100,"99.99")+"|"
v_tot1=(v_tot1+oDados[vCont][3])
v_tot2=(v_tot2+oDados[vCont][4])
v_tot3=(v_tot3+0.00)
v_tot4=(v_tot4+oDados[vCont][5])
v_tot5=(v_tot5+oDados[vCont][6])
v_tot6=(v_tot6+0.00)
x_tot1=(x_tot1+oDados[vCont][3])
x_tot2=(x_tot2+oDados[vCont][4])
x_tot3=(x_tot3+0.00)
x_tot4=(x_tot4+oDados[vCont][5])
x_tot5=(x_tot5+oDados[vCont][6])
x_tot6=(x_tot6+0.00)
vCont++
l++
if LEN(oDados)<vCont .or. IIF(LEN(oDados)>=vCont,cCodGrupo#oDados[vCont][7],)
@ l,01 say "+-------------------------------------------+------+----------+----------+------------+---------------+------+-------------+-----+"
if trab_impr="I"
@ l+1,1 say CHR(27)+"E"+"| TOTAL VENDAS DO GRUPO ===> | |"+TRANS(x_tot1,"999999.999")+"|"+TRANS(x_tot2,"999999.999")+"|"+TRANS(x_tot1+x_tot2,"99999999.999")+"|"+TRANS(x_tot4,"99999999999.999")+"|"+TRANS(((x_tot4/vTotk)*100),"999.99")+"|"+TRANS(x_tot5,"@E 99,999,999.99")+"|"+TRANS(((x_tot5/vTotr)*100),"99.99")+"|"+CHR(27)+"F"
else
@ l+1,1 say "| TOTAL VENDAS DO GRUPO ===> | |"+TRANS(x_tot1,"999999.999")+"|"+TRANS(x_tot2,"999999.999")+"|"+TRANS(x_tot1+x_tot2,"99999999.999")+"|"+TRANS(x_tot4,"99999999999.999")+"|"+TRANS(((x_tot4/vTotk)*100),"999.99")+"|"+TRANS(x_tot5,"@E 99,999,999.99")+"|"+TRANS(((x_tot5/vTotr)*100),"99.99")+"|"
end
@ l+2,1 say "+-------------------------------------------+------+----------+----------+------------+---------------+------+-------------+-----+"
l=l+3
x_tot1=0.00
x_tot2=0.00
x_tot3=0.00
x_tot4=0.00
x_tot5=0.00
x_tot6=0.00
x_tot7=0.00
end
if LEN(oDados)<vCont
@ l,01 say "+-------------------------------------------+------+----------+----------+------------+---------------+------+-------------+-----+"
@ l+1,1 say "| VALOR TOTAL ====> | |"+TRANS(v_tot1,"999999.999")+"|"+TRANS(v_tot2,"999999.999")+"|"+TRANS(v_tot1+v_tot2,"99999999.999")+"|"+TRANS(v_tot4,"99999999999.999")+"| |"+TRANS(v_tot5,"@E 99,999,999.99")+"| |"
@ l+2,1 say "+-------------------------------------------+------+----------+----------+------------+---------------+------+-------------+-----+"
@ l+3,1 say "+"+REPL("=",128)+"+"
@ l+4,1 say "+------------------------------------+"
@ l+5,1 say "| Valor dos Cortes => "+TRANS(v_tot6,"@E 999,999.99")+" |"
@ l+6,1 say "| (%) dos Cortes => "+TRANS( (v_tot6/bVal)*100,"99.99")+" |"
@ l+7,1 say "+------------------------------------+"
elseif l>=58
@ l,01 say "+-------------------------------------------+------+----------+----------+------------+---------------+------+-------------+-----+"
@ l+1,1 say "+"+REPL("=",128)+"+"
end
end
if (trab_impr=='V'); set print to ; end
if (trab_impr=='I'); eject; end
set devi to screen
if (trab_nkey==3)
set print to
Rel_Video(subs(v_arqt,10))
Dele file &v_arqt
end
restscreen(00,00,24,79,Atel)
endd
18 Nov 2013 10:32
28 Nov 2013 15:09
20 Dez 2013 14:10
16 Jan 2014 12:03
Hello,
thanks for the interest to LetoDb.
The current working repository is the Sourceforge CVS, rel-1-mt branch, it isn't outdated, the last update was today ( the information in the Sourceforge's letodb main page isn't correct - that's result of a bug in Sourceforge software ).
You may use the following console command to download it:
cvs checkout -r rel-1-mt -P letodb
The github repository is my personal, I use it for testing purposes.
Regards, Alexander.
I used
cvs -d:pserver:anonymous@letodb.cvs.sourceforge.net:/cvsroot/letodb checkout -r rel-1-mt letodb
and work fine
Regards
17 Mar 2014 10:25
17 Mar 2014 13:42