-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecebi~1.frm
512 lines (486 loc) · 15.5 KB
/
Recebi~1.frm
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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
VERSION 5.00
Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "MSMASK32.OCX"
Begin VB.Form frmRecebimento
Caption = "Recebimentos"
ClientHeight = 3870
ClientLeft = 210
ClientTop = 1425
ClientWidth = 6735
LinkTopic = "Form6"
MDIChild = -1 'True
PaletteMode = 1 'UseZOrder
ScaleHeight = 3870
ScaleWidth = 6735
Begin VB.CommandButton cmdSaida
Caption = "&Retornar"
Height = 420
Left = 5220
TabIndex = 29
Top = 3105
Width = 1230
End
Begin VB.CommandButton cmdExclusao
Caption = "&Excluir"
Height = 420
Left = 5175
TabIndex = 28
Top = 1710
Width = 1230
End
Begin VB.CommandButton cmdAlteracao
Caption = "&Alterar"
Height = 420
Left = 5175
TabIndex = 27
Top = 990
Width = 1230
End
Begin VB.CommandButton cmdInclusao
Caption = "&Incluir"
Height = 420
Left = 5175
TabIndex = 26
Top = 360
Width = 1230
End
Begin VB.ComboBox cmbCodinome
Height = 315
Left = 180
TabIndex = 1
Top = 360
Width = 2490
End
Begin VB.TextBox txtNumeroTitulo
Height = 285
Left = 180
TabIndex = 5
Top = 1035
Width = 1230
End
Begin VB.Frame Frame1
Caption = "Tipo"
Height = 915
Left = 1845
TabIndex = 6
Top = 810
Width = 1725
Begin VB.OptionButton optTipo
Caption = "Duplicata"
Height = 195
Index = 0
Left = 135
TabIndex = 7
Top = 225
Value = -1 'True
Width = 1230
End
Begin VB.OptionButton optTipo
Caption = "Nota Promissória"
Height = 195
Index = 1
Left = 135
TabIndex = 8
Top = 450
Width = 1500
End
Begin VB.OptionButton optTipo
Caption = "Outros"
Height = 195
Index = 2
Left = 135
TabIndex = 9
Top = 675
Width = 1230
End
End
Begin MSMask.MaskEdBox mskCPF_CGC
Height = 330
Left = 2925
TabIndex = 3
Top = 360
Width = 1860
_ExtentX = 3281
_ExtentY = 582
_Version = 327680
PromptInclude = 0 'False
MaxLength = 18
Mask = "##.###.###/####-##"
PromptChar = " "
End
Begin MSMask.MaskEdBox mskValor
Height = 330
Left = 180
TabIndex = 17
Top = 2700
Width = 1545
_ExtentX = 2725
_ExtentY = 582
_Version = 327680
Format = "#,##0.00;(#,##0.00)"
PromptChar = "_"
End
Begin MSMask.MaskEdBox mskDesconto
Height = 330
Left = 180
TabIndex = 21
Top = 3300
Width = 1545
_ExtentX = 2725
_ExtentY = 582
_Version = 327680
Format = "#,##0.00;(#,##0.00)"
PromptChar = "_"
End
Begin MSMask.MaskEdBox mskAcrescimo
Height = 330
Left = 3420
TabIndex = 25
Top = 3300
Width = 1545
_ExtentX = 2725
_ExtentY = 582
_Version = 327680
Format = "#,##0.00;(#,##0.00)"
PromptChar = "_"
End
Begin MSMask.MaskEdBox mskLancamento
Height = 330
Left = 1920
TabIndex = 13
Top = 2040
Width = 1005
_ExtentX = 1773
_ExtentY = 582
_Version = 327680
MaxLength = 8
Format = "ddddd"
Mask = "##/##/##"
PromptChar = " "
End
Begin MSMask.MaskEdBox mskVencimento
Height = 330
Left = 3540
TabIndex = 15
Top = 2040
Width = 1005
_ExtentX = 1773
_ExtentY = 582
_Version = 327680
MaxLength = 8
Format = "ddddd"
Mask = "##/##/##"
PromptChar = " "
End
Begin MSMask.MaskEdBox mskPagamento
Height = 330
Left = 1920
TabIndex = 19
Top = 2700
Width = 1005
_ExtentX = 1773
_ExtentY = 582
_Version = 327680
MaxLength = 8
Format = "ddddd"
Mask = "##/##/##"
PromptChar = " "
End
Begin MSMask.MaskEdBox mskValidadeDesconto
Height = 330
Left = 1920
TabIndex = 23
Top = 3300
Width = 1005
_ExtentX = 1773
_ExtentY = 582
_Version = 327680
MaxLength = 8
Format = "ddddd"
Mask = "##/##/##"
PromptChar = " "
End
Begin MSMask.MaskEdBox mskEmissao
Height = 330
Left = 180
TabIndex = 11
Top = 2040
Width = 1005
_ExtentX = 1773
_ExtentY = 582
_Version = 327680
MaxLength = 8
Format = "ddddd"
Mask = "##/##/##"
PromptChar = " "
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Clientes Cadastrados"
Height = 195
Left = 180
TabIndex = 0
Top = 135
Width = 1485
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "CPF/CGC"
Height = 195
Left = 2925
TabIndex = 2
Top = 135
Width = 705
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "Número do Título"
Height = 195
Left = 180
TabIndex = 4
Top = 810
Width = 1245
End
Begin VB.Label Label4
Caption = "Emissão"
Height = 195
Left = 180
TabIndex = 10
Top = 1845
Width = 1230
End
Begin VB.Label Label5
Caption = "Lançamento"
Height = 195
Left = 1935
TabIndex = 12
Top = 1845
Width = 1230
End
Begin VB.Label Label6
Caption = "Vencimento"
Height = 195
Left = 3510
TabIndex = 14
Top = 1845
Width = 1230
End
Begin VB.Label Label7
Caption = "Valor"
Height = 195
Left = 180
TabIndex = 16
Top = 2475
Width = 1230
End
Begin VB.Label Label8
Caption = "Pagamento"
Height = 195
Left = 1935
TabIndex = 18
Top = 2475
Width = 1230
End
Begin VB.Label Label9
Caption = "Desconto"
Height = 195
Left = 180
TabIndex = 20
Top = 3105
Width = 1230
End
Begin VB.Label Label10
AutoSize = -1 'True
Caption = "Validade Desconto"
Height = 195
Left = 1935
TabIndex = 22
Top = 3105
Width = 1350
End
Begin VB.Label Label11
Caption = "Acréscimo"
Height = 195
Left = 3420
TabIndex = 24
Top = 3105
Width = 1230
End
End
Attribute VB_Name = "frmRecebimento"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'************************************************
' Este código foi retirado da Seriallink.com *
' www.seriallink.com *
' UESLEI R. VALENTINI ([email protected]) *
' Última Revisão: 25/08/99 *
'************************************************
'+----------------------------------------------------------+
'| Projeto: CPR - Contas a Pagar e a Receber |
'| Autor: Adilson da Silva Lima |
'| Data: 17/07/1997 |
'+----------------------------------------------------------+
'| Descrição: Formulário para cadastro de títulos a receber|
'+----------------------------------------------------------+
Private Sub cmbCodinome_Click()
Dim Selecao As String
Selecao = "select * from Cliente where Codinome=" & """"
Selecao = Selecao & cmbCodinome.Text & """"
Set Tabela = Banco.OpenRecordset(Selecao, dbOpenSnapshot)
If Tabela.RecordCount = 0 Then Exit Sub
mskCPF_CGC = Tabela("CPF_CGC")
Tabela.Close
End Sub
Private Sub cmdInclusao_Click()
Set Consulta = Banco.QueryDefs("SelCliente")
Consulta("parCPF_CGC") = mskCPF_CGC
Set Tabela = Consulta.OpenRecordset()
If Tabela.RecordCount = 0 Then
MsgBox "CPF/CGC não cadastrado", 16, "Inclusão"
Tabela.Close
mdkCPF_CGC.SetFocus
Exit Sub
End If
Tabela.Close
Consulta.Close
If txtNumeroTitulo = "" Then
MsgBox "Informe o número do título", 16, "Inclusão"
txtNumeroTitulo.SetFocus
Exit Sub
End If
Selecao = "SELECT * from Recebimento where NumeroTitulo=" & """"
Selecao = Selecao & txtNumeroTitulo & """"
Set Tabela = Banco.OpenRecordset(Selecao, dbOpenSnapshot)
If Tabela.RecordCount > 0 Then
MsgBox "Título já cadastrado", 16, "Inclusão"
Tabela.Close
txtNumeroTitulo.SetFocus
Exit Sub
End If
Tabela.Close
If mskEmissao = " / / " Then
MsgBox "Informe a data de emissão", 16, "Inclusão"
mskEmissao.SetFocus
Exit Sub
End If
If mskVencimento = " / / " Then
MsgBox "Informe a data de vencimento", 16, "Inclusão"
mskVencimento.SetFocus
Exit Sub
End If
If Not ConsisteData(mskEmissao) Then mskmskEmissao.SetFocus
If Not ConsisteData(mskVencimento) Then mskVencimento.SetFocus
If Not mskLancamento = " / / " Then
If Not ConsisteData(mskLancamento) Then mskLancamento.SetFocus
Exit Sub
End If
If Not mskPagamento = " / / " Then
If Not ConsisteData(mskPagamento) Then mskPagamento.SetFocus
Exit Sub
End If
If Not mskValidadeDesconto = " / / " Then
If Not ConsisteData(mskValidadeDesconto) Then mskValidadeDesconto.SetFocus
Exit Sub
End If
If Val(mskValor) = 0 Then
MsgBox "Informe o valor do título", 16, "Inclusão"
mskValor.SetFocus
Exit Sub
End If
On Error GoTo ErrIncluiRecebimento
ErroPar = False
MensErro = "Falha na abertura da consulta"
Set Consulta = Banco.QueryDefs("InsRecebimento")
ErroPar = True
Area.BeginTrans
MensErro = "Falha na alimentação dos parâmetros"
Consulta("parNumeroTitulo") = txtNumeroTitulo
Consulta("parCPF_CGC") = mskCPF_CGC
Consulta("parValor") = mskValor
Consulta("parEmissao") = mskEmissao
Consulta("parVencimento") = mskVencimento
Consulta("parLancamento") = mskLancamento
Consulta("parPagamento") = mskPagamento
Consulta("parDesconto") = mskDesconto
Consulta("parAcrescimo") = mskAcrescimo
Consulta("parValidadeDesconto") = mskValidadeDesconto
For contador = 0 To 2
If optTipo(contador).Value = True Then
Consulta("parTipo") = contador
End If
Next
MensErro = "Falha na gravação dos dados"
Consulta.Execute
Area.CommitTrans
txtNumeroTitulo = ""
mskCPF_CGC = ""
mskValor = 0
mskEmissao = " / / "
mskVencimento = " / / "
mskLancamento = " / / "
mskPagamento = " / / "
mskDesconto = ""
mskAcrescimo = ""
mskValidadeDesconto = " / / "
Exit Sub
ErrIncluiRecebimento:
MsgBox MensErro, 16, "Inclusão"
If ErroPar Then Area.Rollback
Exit Sub
End Sub
Private Sub cmdSaida_Click()
Unload Me
End Sub
Private Sub Form_Load()
ComboCliente cmbCodinome
End Sub
Private Sub mskCPF_CGC_GotFocus()
mskCPF_CGC.Mask = "##############"
End Sub
Private Sub mskCPF_CGC_LostFocus()
Dim temp As String
temp = mskCPF_CGC
Select Case Len(mskCPF_CGC)
Case Is = 11
mskCPF_CGC.Mask = "###.###.###-##"
Case Is = 14
mskCPF_CGC.Mask = "##.###.###/####-##"
End Select
mskCPF_CGC = temp
If Trim$(temp) = "" Then Exit Sub
Set Consulta = Banco.QueryDefs("SelCliente")
Consulta("parCPF_CGC") = temp
Set Tabela = Consulta.OpenRecordset()
' Caso o CPF/CGC não exista, o recordset é fechado e a rotina interrompida
If Tabela.RecordCount = 0 Then
Tabela.Close
Exit Sub
End If
For contador = 0 To cmbCodinome.ListCount - 1
If cmbCodinome.List(contador) = Tabela("Codinome") Then
cmbCodinome.ListIndex = contador
Exit For
End If
Next
Tabela.Close
End Sub
Private Sub txtNumeroTitulo_LostFocus()
Selecao = "SELECT * from Recebimento where NumeroTitulo=" & """"
Selecao = Selecao & txtNumeroTitulo & """"
Selecao = Selecao & " and CPF_CGC="
Selecao = Selecao & mskCPF_CGC
Set Tabela = Banco.OpenRecordset(Selecao, dbOpenSnapshot)
If Tabela.RecordCount = 0 Then Exit Sub
optTipo(Tabela("Tipo")).Value = True
mskEmissao = Tabela("Emissao")
If Not IsNull(Tabela("Lancamento")) Then mskLancamento = Tabela("Lancamento")
mskVencimento = Tabela("Vencimento")
If Not IsNull(Tabela("Pagamento")) Then mskPagamento = Tabela("Pagamento")
If Not IsNull(Tabela("ValidadeDesconto")) Then mskValidadeDesconto = Tabela("ValidadeDesconto")
mskValor = Tabela("Valor")
If Not IsNull(Tabela("Desconto")) Then mskDesconto = Tabela("Desconto")
If Not IsNull(Tabela("Acrescimo")) Then mskAcrescimo = Tabela("Acrescimo")
Tabela.Close
End Sub