-
Notifications
You must be signed in to change notification settings - Fork 0
/
FTECLAF2.PRG
344 lines (344 loc) · 10.7 KB
/
FTECLAF2.PRG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
*****************************************************************************
* Fun‡Æo : FTECLAF2.PRG *
* Objetivo : Fun‡äes de Consulta pela Tecla F2 *
* Autor : Joacir *
* Data : 16/03/99 *
*****************************************************************************
* Fun‡Æo : L_his() *
* Objetivo : Abre janela com hist¢ricos Cadastrados *
*****************************************************************************
FUNCTION L_his()
local Janela
local Linha22 := savescreen(22,00,22,79)
local nOpcao := 0
local aCod := {}
local getlist := {}
Set Key -1 to
setcolor("bg+ /n,n/ w")
his->(dBSetOrder(2))
his->(dBGoTop())
Do while his->(!EOF())
aadd(aCod,str(his->CODIGO,4,0) + " - " + his->descri)
his->(dBSkip())
Enddo
his->(dBSetOrder(1))
@ 22,01 clear to 22,78
if len(aCod) = 0
Mens("NÆo Existem Hist¢ricos Cadastrados !!!",.t.,.t.)
else
Janela := savescreen(07,38,19,78)
@ 07,38 clear to 19,78
@ 07,38 to 19,78
@ 08,39 say padc("Hist¢ricos Cadastrados",39)
@ 09,38 say "Ã" + replicate("Ä",39) + "´"
nOpcao := Achoice(10,40,18,76,aCod)
restscreen(07,38,19,78,Janela)
if nOpcao # 0
clear typeahead && Limpa Buffer do Teclado
Keyboard(Substr(aCod[nOpcao],1,4)) + chr(13) && Manda C¢digo para o Teclado
endif
endif
restscreen(22,00,22,79,Linha22)
setcolor("bg+ /n,bg+ /n")
Set Key -1 to L_his()
Return nil
*****************************************************************************
* Fun‡Æo : L_ban() *
* Objetivo : Abre janela com Bancos Cadastradas *
*****************************************************************************
FUNCTION L_Ban()
local Janela
local Linha22 := savescreen(22,00,22,79)
local nOpcao := 0
local aCod := {}
local getlist := {}
setcolor("bg+ /n,n /w")
Set Key -1 to
ban->(dBSetOrder(2))
ban->(dBGoTop())
Do while ban->(!EOF())
aadd(aCod,str(ban->nconta,10,0) + " - " + ban->banco)
ban->(dBSkip())
Enddo
ban->(dBSetOrder(1))
@ 22,01 clear to 22,78
if len(aCod) = 0
Mens("NÆo Existem Bancos Cadastrados !!!",.t.,.t.)
else
Janela := savescreen(07,38,19,78)
@ 07,38 clear to 19,78
@ 07,38 to 19,78
@ 08,39 say padc("Bancos Cadastrados",39)
@ 09,38 say "Ã" + replicate("Ä",39) + "´"
nOpcao := Achoice(10,40,18,76,aCod)
restscreen(07,38,19,78,Janela)
if nOpcao # 0
clear typeahead
Keyboard(Substr(aCod[nOpcao],1,10)) + chr(13)
endif
endif
restscreen(22,00,22,79,Linha22)
setcolor("bg+ /n,bg+ /n")
Set Key -1 to L_ban()
Return nil
*****************************************************************************
* Fun‡Æo : L_CLI() *
* Objetivo : Abre janela com CLIENTES CadastradoS *
*****************************************************************************
FUNCTION L_CLI()
local Janela
local Linha22 := savescreen(22,00,22,79)
local nOpcao := 0
local aCod := {}
local getlist := {}
Set Key -1 to
setcolor("bg+ /n,n /w")
cli->(dBSetOrder(2))
cli->(dbgotop())
Do while cli->(!EOF())
if cli->tipocf = "C"
aadd(aCod,str(cli->CODIGO,6,0) + " - " + cli->nome)
endif
cli->(dBSkip())
Enddo
cli->(dBSetOrder(1))
@ 22,01 clear to 22,78
if len(aCod) = 0
Mens("NÆo Existem Clientes Cadastrados !!!",.t.,.t.)
else
Janela := savescreen(07,36,19,78)
@ 07,36 clear to 19,78
@ 07,36 to 19,78
@ 08,37 say padc("Clientes Cadastrados",41)
@ 09,36 say "Ã" + replicate("Ä",41) + "´"
nOpcao := Achoice(10,38,18,76,aCod)
restscreen(07,36,19,78,Janela)
if nOpcao # 0
clear typeahead
Keyboard(Substr(aCod[nOpcao],1,6)) + chr(13)
endif
endif
restscreen(22,00,22,79,Linha22)
setcolor("bg+ /n,bg+ /n")
Set Key -1 to L_cli()
Return nil
*****************************************************************************
* Fun‡Æo : L_for() *
* Objetivo : Abre janela com Fornecedores cadastrados *
*****************************************************************************
FUNCTION L_for()
local Janela
local Linha22 := savescreen(22,00,22,79)
local nOpcao := 0
local aCod := {}
local getlist := {}
Set Key -1 to
setcolor("bg+ /n,n /w")
cli->(dBSetOrder(2))
cli->(dbgotop())
Do while cli->(!EOF())
if cli->tipocf = "F"
aadd(aCod,str(cli->CODIGO,6,0) + " - " + cli->nome)
endif
cli->(dBSkip())
Enddo
cli->(dBSetOrder(1))
@ 22,01 clear to 22,78
if len(aCod) = 0
Mens("NÆo Existem Fornecedores Cadastrados !!!",.t.,.t.)
else
Janela := savescreen(07,36,19,78)
@ 07,36 clear to 19,78
@ 07,36 to 19,78
@ 08,37 say padc("Fornecedores Cadastrados",41)
@ 09,36 say "Ã" + replicate("Ä",41) + "´"
nOpcao := Achoice(10,38,18,76,aCod)
restscreen(07,36,19,78,Janela)
if nOpcao # 0
clear typeahead
Keyboard(Substr(aCod[nOpcao],1,6)) + chr(13)
endif
endif
restscreen(22,00,22,79,Linha22)
setcolor("bg+ /n,bg+ /n")
Set Key -1 to L_for()
Return nil
*****************************************************************************
* Fun‡Æo : L_lan() *
* Objetivo : Abre janela com Lancamentos cadastrados *
*****************************************************************************
FUNCTION L_lan()
local Janela
local Linha22 := savescreen(22,00,22,79)
local nOpcao := 0
local aCod := {}
local hist := space(30)
local getlist := {}
set key -1 to
setcolor("bg+ /n,n /w")
abt->(dBSetOrder(2))
abt->(dbgotop())
Do while abt->(!EOF())
his->(dbseek(str(abt->codhis,4,0)))
if his->(found())
hist := his->descri
else
hist := "Hist¢rico nÆo encontrado !"
endif
aadd(aCod,substr(abt->CODcli,7,1) + substr(abt->codcli,1,6) + abt->nrodoc + " - " + substr(hist,1,23) + " - " + dtoc(abt->dtavcm) + " - " + str(abt->valorap,12,2))
abt->(dBSkip())
Enddo
abt->(dBSetOrder(1))
@ 22,01 clear to 22,78
if len(aCod) = 0
Mens("NÆo Existem Lan‡amentos Cadastrados !!!",.t.,.t.)
else
Janela := savescreen(05,04,19,76)
@ 05,04 clear to 19,76
@ 05,04 to 19,76
@ 06,05 say padc("Lan‡amentos de Contas a Pagar e Receber",70)
@ 07,04 say "Ã" + replicate("Ä",71) + "´"
nOpcao := Achoice(08,06,18,74,aCod)
restscreen(05,04,19,76,Janela)
if nOpcao # 0
clear typeahead
Keyboard(Substr(aCod[nOpcao],1,1)+substr(acod[nopcao],2,6)+chr(13)+substr(acod[nopcao],8,8)+chr(13))
endif
endif
set key -1 to l_lan()
restscreen(22,00,22,79,Linha22)
setcolor("bg+ /n,bg+ /n")
return nil
*****************************************************************************
* Fun‡Æo : L_bax() *
* Objetivo : Abre janela com Baixas cadastrados *
*****************************************************************************
FUNCTION L_bax()
local Janela
local Linha22 := savescreen(22,00,22,79)
local nOpcao := 0
local aCod := {}
local hist := space(30), clif := space(30)
local getlist := {}
set key -1 to
setcolor("bg+ /n,n /w")
pag->(dBSetOrder(2))
pag->(dbgotop())
Do while pag->(!EOF())
his->(dbseek(str(pag->codhis,4,0)))
if his->(found())
hist := his->descri
else
hist := "Hist¢rico nÆo encontrado !"
endif
cli->(dbseek(pag->clifor))
if cli->(found())
clif := cli->nome
else
clif := "NÆo encontrado !"
endif
aadd(aCod,str(pag->ndupli,8,0) + " " + substr(clif,1,19) + " " + substr(hist,1,16) + " " + dtoc(pag->dtapag) + " " + str(pag->valorpg,12,2))
pag->(dBSkip())
Enddo
pag->(dBSetOrder(1))
@ 22,01 clear to 22,78
if len(aCod) = 0
Mens("NÆo Existem Baixas Cadastradas !!!",.t.,.t.)
else
Janela := savescreen(05,04,19,76)
@ 05,04 clear to 19,76
@ 05,04 to 19,76
@ 06,05 say padc("Baixas dos Lan‡amentos de Contas a Pagar e Receber",70)
@ 07,04 say "Ã" + replicate("Ä",71) + "´"
nOpcao := Achoice(08,06,18,74,aCod)
restscreen(05,04,19,76,Janela)
if nOpcao # 0
clear typeahead
Keyboard(Substr(aCod[nOpcao],1,8)+chr(13))
endif
endif
set key -1 to l_bax()
restscreen(22,00,22,79,Linha22)
setcolor("bg+ /n,bg+ /n")
return nil
*****************************************************************************
* Fun‡Æo : L_mov() *
* Objetivo : Abre janela de Movimentos banc rios *
*****************************************************************************
FUNCTION L_Mov()
local Janela
local Linha22 := savescreen(22,00,22,79)
local nOpcao := 0
local aCod := {}
local hist := space(30)
local getlist := {}
setcolor("bg+ /n,n /w")
Set Key -1 to
mov->(dBSetOrder(2))
mov->(dBGoTop())
Do while mov->(!EOF())
ban->(dbseek(str(mov->nconta,10,0)))
if ban->(found())
hist := ban->banco
else
hist := "Conta nÆo encontrado !"
endif
aadd(aCod,str(mov->codmov,6,0) + " - " + hist + " - " + dtoc(mov->dtamov) + " - " + str(mov->valor,12,2))
mov->(dBSkip())
Enddo
mov->(dBSetOrder(1))
@ 22,01 clear to 22,78
if len(aCod) = 0
Mens("NÆo Existem Movimentos Cadastrados !!!",.t.,.t.)
else
Janela := savescreen(05,04,19,76)
@ 05,04 clear to 19,76
@ 05,04 to 19,76
@ 06,05 say padc("Movimentos Banc rios",70)
@ 07,04 say "Ã" + replicate("Ä",71) + "´"
nOpcao := Achoice(08,06,18,74,aCod)
restscreen(05,04,19,76,Janela)
if nOpcao # 0
clear typeahead
Keyboard(Substr(aCod[nOpcao],1,6)+chr(13))
endif
endif
Set key -1 to l_mov()
restscreen(22,00,22,79,Linha22)
setcolor("bg+ /n,bg+ /n")
Return nil
*****************************************************************************
* Fun‡Æo : L_IMP() *
* Objetivo : Abre janela com IMPRESSORAS Cadastradas *
*****************************************************************************
FUNCTION L_IMP()
local Janela
local Linha22 := savescreen(22,00,22,79)
local nOpcao := 0
local aCod := {}
local getlist := {}
setcolor("bg+ /n,n /w")
IMP->(dBSetOrder(2))
IMP->(dBGoTop())
Do while IMP->(!EOF())
aadd(aCod,str(IMP->CODI_IMP,1,0) + " - " + IMP->NOME_IMP)
IMP->(dBSkip())
Enddo
IMP->(dBSetOrder(1))
@ 22,01 clear to 22,78
if len(aCod) = 0
Mens("NÆo Existem Impressoras Cadastradas !!! <ENTER>:",.t.,.t.)
else
Janela := savescreen(08,51,14,71)
@ 09,21 say padc("Impressoras",39)
@ 22,01 say padc("Selecione a Impressora correta.",78) color("W+/n")
nOpcao := Achoice(11,21,13,59,aCod)
if nOpcao # 0
clear typeahead
imp->(dbseek(substr(acod[nopcao],1,1)))
endif
endif
setcolor("bg+ /n,bg+ /n")
restscreen(22,00,22,79,Linha22)
Return nil
*****************************************************************************