-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmListadoStockyPrecios.frm
136 lines (124 loc) · 4.39 KB
/
frmListadoStockyPrecios.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
VERSION 5.00
Begin VB.Form frmListadoStockyPrecios
Caption = "Listado de Stock y Precios"
ClientHeight = 3840
ClientLeft = 120
ClientTop = 450
ClientWidth = 6870
LinkTopic = "Form1"
ScaleHeight = 3840
ScaleWidth = 6870
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame1
Caption = "Filtros"
Height = 2055
Left = 360
TabIndex = 1
Top = 240
Width = 6015
Begin VB.ComboBox cmRubro
Height = 315
Left = 960
Style = 2 'Dropdown List
TabIndex = 3
Top = 480
Width = 3735
End
Begin VB.ComboBox cmMarca
Height = 315
ItemData = "frmListadoStockyPrecios.frx":0000
Left = 960
List = "frmListadoStockyPrecios.frx":0007
Style = 2 'Dropdown List
TabIndex = 2
Top = 1080
Width = 3735
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "Rubro:"
Height = 195
Left = 360
TabIndex = 5
Top = 600
Width = 480
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "Marca:"
Height = 195
Left = 360
TabIndex = 4
Top = 1200
Width = 495
End
End
Begin VB.CommandButton cmdImprimirDetalle
Caption = "Imprimir Detalle de Totales"
Height = 1095
Left = 2400
Picture = "frmListadoStockyPrecios.frx":0014
Style = 1 'Graphical
TabIndex = 0
Top = 2520
Width = 1575
End
End
Attribute VB_Name = "frmListadoStockyPrecios"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdImprimirDetalle_Click()
idDesdeRubro = 0
idHastRubro = 0
idDesdearca = 0
idHastaMarca = 0
If cmRubro.ItemData(cmRubro.ListIndex) = 0 Then
idDesdeRubro = 0: idHastaRubro = 99999
Else
idDesdeRubro = cmRubro.ItemData(cmRubro.ListIndex): idHastaRubro = cmRubro.ItemData(cmRubro.ListIndex)
End If
If cmMarca.ItemData(cmMarca.ListIndex) = 0 Then
idDesdeMarca = 0: idHastaMarca = 99999
Else
idDesdeMarca = cmMarca.ItemData(cmMarca.ListIndex): idHastaMarca = cmMarca.ItemData(cmMarca.ListIndex)
End If
cn.Open
With ListadoStockYPrecios.Sections("Sección4")
.Controls("lblRubro").Caption = cmRubro.Text
.Controls("lblMarca").Caption = cmMarca.Text
End With
Set rs = cn.Execute("SELECT Articulos.CodBar, Marcas.Marca, Rubros.Rubro, Articulos.Descripcion, Articulos.Venta, Articulos.VentaRevendedor, Articulos.Stock FROM Articulos INNER JOIN Marcas ON Articulos.idMarca = Marcas.idMarca INNER JOIN Rubros ON Articulos.idRubro = Rubros.idRubro where articulos.idMarca between " & idDesdeMarca & " and " & idHastaMarca & " and Articulos.idRubro between " & idDesdeRubro & " and " & idHastaRubro & " ORDER BY Marcas.Marca, Rubros.Rubro, cast(Articulos.CodBar as numeric)")
Set ListadoStockYPrecios.DataSource = rs
ListadoStockYPrecios.WindowState = 2
ListadoStockYPrecios.Show 1
cn.Close
End Sub
Private Sub Form_Load()
Dim rs As New ADODB.Recordset
cn.Open
Set rs = cn.Execute("VerRubros")
cmRubro.AddItem ("Todos")
cmRubro.ItemData(cmRubro.NewIndex) = 0
Do While rs.EOF = False
cmRubro.AddItem (rs!Rubro)
cmRubro.ItemData(cmRubro.NewIndex) = rs!IdRubro
rs.MoveNext
Loop
cmRubro.ListIndex = 0
Set rs = Nothing
Set rs = cn.Execute("VerMarcas")
cmMarca.Clear
cmMarca.AddItem ("Todas")
cmMarca.ItemData(cmMarca.NewIndex) = 0
Do While rs.EOF = False
cmMarca.AddItem (rs!Marca)
cmMarca.ItemData(cmMarca.NewIndex) = rs!idMarca
rs.MoveNext
Loop
cmMarca.ListIndex = 0
rs.Close
Set rs = Nothing
cn.Close
End Sub