-
Notifications
You must be signed in to change notification settings - Fork 0
/
repuestos_reportes.php
244 lines (225 loc) · 13.7 KB
/
repuestos_reportes.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Reportes de Repuestos</title>
<?php include_once("includes/head.inc"); ?>
</head>
<?php include_once("includes/bodyHead.inc"); ?>
<!-- PONER PAGINAS AQUI -->
<div class="container-fluid">
<!-- BOTONES DE EXPORTAR -->
<div class="card shadow mb-1">
<a href="#CardExportar" class="d-block card-header py-3 collapsed" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="CardExportar">
<h6 class="m-0 font-weight-bold text-gray-800">Exportar a Excel</h6>
</a>
<div class="collapse" id="CardExportar">
<div class="m-2">
<a href="Back/Exportar.php/?exportar=IngresoRepuesto" class="btn btn-outline-info">Exportar Entradas</a>
<a href="Back/Exportar.php/?exportar=SalidaRepuestos" class="btn btn-outline-dark ">Exportar Salidas</a>
<a href="Back/Exportar.php/?exportar=InventarioRepuestos" class="btn btn-outline-success ">Exportar Inventario</a>
</div>
</div>
</div>
<!-- INGRESO REPUESTOS -->
<div class="card shadow mb-1">
<a href="#CardReporteIngresoRepuestos" class="d-block card-header py-3 collapsed" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="CardReporteIngresoRepuestos">
<h6 class="m-0 font-weight-bold text-gray-800">Reporte Ingreso de Repuestos</h6>
</a>
<div class="collapse" id="CardReporteIngresoRepuestos">
<div class="table-responsive">
<div class="card shadow">
<div class="card-body">
<div class="m-0 p-0">
<table id="Tbl_Reporte_Compra" class="table table-striped table-sm">
<thead>
<tr>
<th><label>Id</label></th>
<th><label>Fecha</label></th>
<th><label>Código</label></th>
<th><label>Descripción</label></th>
<th><label>Cantidad</label></th>
<th><label>Medida</label></th>
<th><label>Comprobante</label></th>
</tr>
</thead>
<?php include_once('includes/conexion.inc'); ?>
<?php
if (!$conex) {
echo 'NoConex';
} else {
$queryIngresos = "SELECT id, Fecha, Codigo, Descripcion, Cantidad, Medida, Comprobante FROM repuesto ORDER BY Fecha DESC;";
$result = mysqli_query($conex, $queryIngresos);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?php echo $row['id']; ?></td>
<td><?php echo $row['Fecha']; ?></td>
<td><?php echo $row['Codigo']; ?></td>
<td><?php echo $row['Descripcion']; ?></td>
<td><?php echo $row['Cantidad']; ?></td>
<td><?php echo $row['Medida']; ?></td>
<td><?php echo $row['Comprobante']; ?></td>
</tr>
<?php
}
}
} ?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- SALIDAS REPUESTOS -->
<div class="card shadow mb-1">
<a href="#CardReporteSalidaRepuestos" class="d-block card-header py-3 collapsed" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="CardReporteSalidaRepuestos">
<h6 class="m-0 font-weight-bold text-gray-800">Reporte Salida Repuestos</h6>
</a>
<div class="collapse" id="CardReporteSalidaRepuestos">
<div class="table-responsive">
<div class="card shadow">
<div class="card-body">
<div class="m-0 p-0">
<table id="Tbl_Reporte_Salidas" class="table table-striped table-sm">
<thead>
<tr>
<th><label>Id</label></th>
<th><label>Fecha</label></th>
<th><label>Código de Repuesto</label></th>
<th><label>Descripción</label></th>
<th><label>Cantidad</label></th>
<th><label>Código de Máquina</label></th>
<th><label>Responsable</label></th>
</tr>
</thead>
<?php include_once('includes/conexion.inc'); ?>
<?php
if (!$conex) {
echo 'NoConex';
} else {
$querySalidas = "SELECT rs.id, rs.Fecha, r.Codigo AS codRepuesto, r.Descripcion, rs.Cantidad, m.Codigo AS codMaquina, desp.nombre FROM repuesto_salida rs right JOIN repuesto r ON r.id = rs.idRepuesto INNER JOIN maquinaria m ON m.Id = rs.idMaquina INNER JOIN despachador desp ON desp.id = rs.idResponsable ORDER BY rs.Fecha DESC;";
$result = mysqli_query($conex, $querySalidas);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?php echo $row['id']; ?></td>
<td><?php echo $row['Fecha']; ?></td>
<td><?php echo $row['codRepuesto']; ?></td>
<td><?php echo $row['Descripcion']; ?></td>
<td><?php echo $row['Cantidad']; ?></td>
<td><?php echo $row['codMaquina']; ?></td>
<td><?php echo $row['nombre']; ?></td>
</tr>
<?php
}
}
} ?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- INVENTARIO ACTUALIZADO -->
<div class="card shadow mb-1">
<a href="#ReporteInventarioActualizado" class="d-block card-header py-3 collapsed" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="ReporteInventarioActualizado">
<h6 class="m-0 font-weight-bold text-gray-800">Reporte Inventario de Repuestos</h6>
</a>
<div class="collapse" id="ReporteInventarioActualizado">
<div class="table-responsive">
<div class="card shadow">
<div class="card-body">
<div class="m-0 p-0">
<table id="Tbl_Reporte_Inventario" class="table table-striped table-sm">
<thead>
<tr>
<th><label>Código</label></th>
<th><label>Descripción</label></th>
<th><label>Cantidad</label></th>
<th><label>Medida</label></th>
</tr>
</thead>
<?php include_once('includes/conexion.inc'); ?>
<?php
if (!$conex) {
echo 'NoConex';
} else {
$queryInventario = "SELECT r.Codigo, r.Descripcion, ri.Cantidad, r.Medida FROM repuesto_inventario AS ri INNER JOIN repuesto AS r on r.Codigo = ri.Codigo GROUP BY r.Codigo;";
$result = mysqli_query($conex, $queryInventario);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?php echo $row['Codigo']; ?></td>
<td><?php echo $row['Descripcion']; ?></td>
<td><?php echo $row['Cantidad']; ?></td>
<td><?php echo $row['Medida']; ?></td>
</tr>
<?php
}
}
} ?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- INGRESOS Y SALIDAS POR RANGO FECHAS -->
<div class="card shadow mb-1">
<a href="#" class="d-block card-header py-3">
<h6 class="m-0 font-weight-bold text-gray-800">Reporte ingresos o salidas por rango de fechas</h6>
</a>
<div class="card-body">
<div class='row mb-4'>
<div class="col-md-1">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="chkIngresos" required>
<label class="custom-control-label" for="chkIngresos">Ingresos</label>
</div>
</div>
<div class="col-md-1">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="chkSalidas" required>
<label class="custom-control-label" for="chkSalidas">Salidas</label>
</div>
</div>
<div class="col-md-2">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Fecha inicio</span>
</div>
<input type="date" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" class="form-control" ID="FechaInicio" name='FechaInicio' required>
</div>
</div>
<div class="col-md-2">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Fecha fin</span>
</div>
<input type="date" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}" class="form-control" ID="FechaFin" name='FechaFin' required>
</div>
</div>
<div class="col-md-2">
<button id="BtnBuscarReporte" class="ui button yellow">Buscar</button>
<button id="BtnCancelar" class="ui button red d-none">Cancelar</button>
</div>
</div>
<div class="divReporte">
</div>
</div>
</div>
</div>
<!-- FIN PONER PAGINAS AQUI -->
<?php
include_once("includes/bodyFooter.inc");
include_once("includes/footer.inc");
?>
<script src="js/Repuestos_Reportes.js"></script>
</body>
</html>