Código: Selecionar todos
function ecad(xbusc,area,lin,col)
privat arq
arq = select()
select(area)
go top
tela55:=savescreen(15,1,25,22)
if empty(xbusc)
if area=1
xcodpro:=lis_ecad(area)
xcodpro:=codigo
endif
if area=2
XCODESTI:=LIS_ECAD(AREA)
xcodpost:=XCODESTI:=CODIGO
XCODIGO:=CODIGO
xnompost:=nome
endif
if area=4
xcodremet:=lis_ecad(area)
xcodremet:=codigo
endif
if area=5
xmotor:=lis_ecad(area)
xmotor:=nome
endif
if area=6
xnplaca:=lis_ecad(area)
xnplaca:=placa
endif
if area=7
xcidade:=xcident:=xdestino:=lis_ecad(area)
xcidade:=xcident:=xdestino:=LOCALIDADE
endif
if area=13
xplcontas:=lis_ecad(area)
xplcontas:=codigo
endif
select(arq)
RETURN .F.
endif
IF AREA=1 .or. area=2 .or. area=4 .or. area=13
ordsetfocus(1)
ENDIF
if area=6
ordsetfocus(3)
endif
if area=7 .or. area=5
ordsetfocus(2)
endif
if area=13 .and. xbusc="99999999"
select(arq)
return .t.
endif
seek xbusc
if ! found()
select(arq)
atenc(19,10,"NÆo foi possivel localiza.")
RETURN .f.
else
REC:=RECNO()
if area=1
public xcodpro
xcodpro:=CODIGO
select(arq)
restscreen(15,1,25,22,tela55)
@ lin,col say transform(proveic->nome,"@!@S26")
endif
IF AREA=2
public XCODESTI,xcodpost,xnompost
xcodpost:=xCODESTI:=CODIGO
xnompost:=nome
XCODIGO:=CODIGO
select(arq)
restscreen(15,1,25,22,tela55)
@ lin,col say transform(forneced->nome,"@!@S26")
ENDIF
IF AREA=4
public Xcodremet
xcodremet:=codigo
restscreen(15,1,25,22,tela55)
@ lin,col say transform(remet->nome,"@!@S26")
select(arq)
ENDIF
IF AREA=5
public Xmotor
xmotor:=nome
select(arq)
ENDIF
IF AREA=6
public Xplaca,xproprie
xnplaca:=placa
select 1
ordsetfocus(1)
seek veiculo->codpro
xproprie:=nome
select(arq)
ENDIF
IF AREA=7
public xcidade,Xdestino,xuf,xufent,xcident
xcidade:=xcident:=xdestino:=localidade
xufent:=xuf:=uf
select(arq)
ENDIF
IF AREA=13
public xplcontas
xplcontas:=codigo
select(arq)
ENDIF
SELECT(ARQ)
RETURN .t.
endif
select(arq)
return(xbusc)
function lis_ecad(area)
ACUMULA =""
v = ""
XX = 0
MODO = 4
cor = SetColor()
save screen to telw
setcolor(COR4)
select(area)
if area=6
ordsetfocus(3)
ELSE
ORDSETFOCUS(2)
ENDIF
set softseek on
seek v
_zz = v
set softseek off
if (EOF())
goto top
endif
if area=1 .or. area=2 .or. area=4
Private vetor1[1], vetor2[1], vetor3[1]
Vetor1[1] := "nome"
Vetor2[1] := "@S50"
Vetor3[1] := "Nome/Razao"
if area=1
show(10,1,25,32,"Propriet rio de veiculo.")
endif
if area=2
show(10,1,25,60,"Destinat rio.")
endif
if area=4
show(10,1,25,32,"Remetente.")
endif
endif
if area=5
Private vetor1[4], vetor2[4], vetor3[4]
Vetor1[1] := "Nome"
Vetor1[2] := "cpf"
Vetor1[3] := "cnh"
Vetor2[1] := "@!@S30"
Vetor2[2] := "@R 999.999.999-99"
Vetor3[1] := "Motorista"
Vetor3[2] := "C.P.F."
Vetor3[3] := "C.N.H."
show(10,1,25,32,"Motorista")
endif
if area=6
Private vetor1[4], vetor2[4], vetor3[4]
Vetor1[1] := "placa"
Vetor1[2] := "cid_pl"
Vetor1[3] := "uf_pl"
Vetor1[4] := "modelo"
Vetor2[1] := "@r !!!-9999"
Vetor2[2] := "@!@S15"
Vetor2[4] := "@!"
Vetor3[1] := "Placa"
Vetor3[2] := "Cid.Placa"
Vetor3[3] := "U.F."
Vetor3[4] := "Modelo"
show(10,1,25,32,"Ve¡culo")
endif
if area=7
Private vetor1[2], vetor2[2], vetor3[2]
Vetor1[1] := "localidade"
Vetor1[2] := "uf"
Vetor2[1] := "@S20"
Vetor3[1] := "Localidade"
show(10,1,25,32,"Localidade.")
endif
if area=13
Private vetor1[2], vetor2[2], vetor3[2]
Vetor1[1] := "codigo"
Vetor1[2] := "descricao"
Vetor2[1] := "@R 99.99.99.99"
Vetor2[2] := "@!@S30"
Vetor3[1] := "Pl.Contas"
show(10,1,25,72,"Arq. de plano de contas.")
endif
if area=1 .or. area=2 .or. area=5 .or. area=6 .or. area=7
CONTORNO(11,01,25,62,1)
CONTORNO(12,02,22,61,2)
CONTORNO(22,02,24,61,2)
@ 23,3 clear to 23,60
endif
if area=4 .or. area=13
CONTORNO(11,01,25,71,1)
CONTORNO(12,02,22,70,2)
CONTORNO(22,02,24,70,2)
@ 23,3 clear to 23,70
endif
setcolor(cor_pisca)
@ 23,03 say chr(22)
setcolor(COR2)
if area=1 .or. area=2 .or. area=5 .or. area=6 .or. area=7
Dbedit(13,03,21,60,vetor1,"aux_eca",vetor2,vetor3,chr(196)," ",.t.,.t.)
endif
if area=4 .or. area=13
Dbedit(13,03,21,70,vetor1,"aux_eca",vetor2,vetor3,chr(196)," ",.t.,.t.)
endif
select(area)
IF AREA=6
ORDSETFOCUS(3)
endif
if area=5
ordsetfocus(2)
endif
if area=1 .or. area=2 .or. area=4 .or. area=7
ORDSETFOCUS(1)
ENDIF
restore screen from telw
set color to (cor)
return(CODIGO)
function aux_eca
parameters modo, PONTEIRO
private sv_cor
sv_cor = SetColor()
if LastKey()=27
return 0
endif
if LastKey()=13
XX= XX+LASTKEY()
IF XX >13
return 0
ENDIF
endif
if modo = 4
if LastKey()=8
acumula:= SubStr(acumula, 1, Len(acumula) - 1)
elseif (Len(acumula) <= 35)
acumula:= acumula + Chr(LastKey())
endif
@ 23,03 say Space(20)
@ 23,03 say UPPER(acumula)
setcolor(cor_pisca)
@ 23,col() say chr(22)
setcolor(COR2)
set softseek on
seek alltrim(_zz) + UPPER(acumula)
set softseek off
endif
set color to (sv_cor)
return 1


