Autosave: 20260212-175210
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 140 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 42 KiB |
BIN
assets/uploads/vouchers/698e0b63b3871-970.png
Normal file
|
After Width: | Height: | Size: 113 KiB |
BIN
assets/uploads/vouchers/698e0bda77369-035.png
Normal file
|
After Width: | Height: | Size: 280 KiB |
BIN
assets/uploads/vouchers/698e0c0fa1a2d-812.png
Normal file
|
After Width: | Height: | Size: 119 KiB |
BIN
assets/uploads/vouchers/698e0c52541bd-119.png
Normal file
|
After Width: | Height: | Size: 147 KiB |
BIN
assets/uploads/vouchers/698e0c92209a4-240.png
Normal file
|
After Width: | Height: | Size: 330 KiB |
BIN
assets/uploads/vouchers/698e0cbc0b0df-208.png
Normal file
|
After Width: | Height: | Size: 150 KiB |
BIN
assets/uploads/vouchers/698e0d0b60f43-837.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
assets/uploads/vouchers/698e0d734b449-153.png
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
assets/uploads/vouchers/698e0dc44f7af-279.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
assets/uploads/vouchers/698e0deeb196b-420.png
Normal file
|
After Width: | Height: | Size: 243 KiB |
BIN
assets/uploads/vouchers/698e0e121d3b8-287.png
Normal file
|
After Width: | Height: | Size: 173 KiB |
BIN
assets/uploads/vouchers/698e0e445ac17-486.png
Normal file
|
After Width: | Height: | Size: 297 KiB |
BIN
assets/uploads/vouchers/698e0e6dc9ce5-931.png
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
assets/uploads/vouchers/698e0e9403997-850.png
Normal file
|
After Width: | Height: | Size: 265 KiB |
BIN
assets/uploads/vouchers/698e0ecc0c642-292.png
Normal file
|
After Width: | Height: | Size: 143 KiB |
BIN
assets/uploads/vouchers/698e0ef1c3c6c-999.png
Normal file
|
After Width: | Height: | Size: 281 KiB |
BIN
assets/uploads/vouchers/698e0f13cc145-126.png
Normal file
|
After Width: | Height: | Size: 270 KiB |
BIN
assets/uploads/vouchers/698e0f3d05ff3-122.png
Normal file
|
After Width: | Height: | Size: 150 KiB |
BIN
assets/uploads/vouchers/698e0f668d380-543.png
Normal file
|
After Width: | Height: | Size: 304 KiB |
BIN
assets/uploads/vouchers/698e0f86e4858-036.png
Normal file
|
After Width: | Height: | Size: 247 KiB |
BIN
assets/uploads/vouchers/698e0fb65c76a-304.png
Normal file
|
After Width: | Height: | Size: 137 KiB |
BIN
assets/uploads/vouchers/698e0fee40970-769.png
Normal file
|
After Width: | Height: | Size: 163 KiB |
BIN
assets/uploads/vouchers/698e101bdc50f-346.png
Normal file
|
After Width: | Height: | Size: 140 KiB |
BIN
assets/uploads/vouchers/698e103dad484-292.png
Normal file
|
After Width: | Height: | Size: 233 KiB |
BIN
assets/uploads/vouchers/698e1064a7d58-254.png
Normal file
|
After Width: | Height: | Size: 278 KiB |
BIN
assets/uploads/vouchers/698e108a65915-495.png
Normal file
|
After Width: | Height: | Size: 138 KiB |
BIN
assets/uploads/vouchers/698e10bee27c1-562.png
Normal file
|
After Width: | Height: | Size: 141 KiB |
BIN
assets/uploads/vouchers/698e10f1e9c3a-948.png
Normal file
|
After Width: | Height: | Size: 171 KiB |
BIN
assets/uploads/vouchers/698e1119415f2-248.png
Normal file
|
After Width: | Height: | Size: 159 KiB |
BIN
assets/uploads/vouchers/698e1149310b1-933.png
Normal file
|
After Width: | Height: | Size: 197 KiB |
BIN
assets/uploads/vouchers/698e116866aec-824.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
assets/uploads/vouchers/698e118f8b613-038.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
145
buscador_inventario.php
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
if (!isset($_SESSION['user_id'])) {
|
||||||
|
header('Location: login.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
require_once 'db/config.php';
|
||||||
|
require_once 'layout_header.php';
|
||||||
|
|
||||||
|
$codigo_unico_buscado = isset($_GET['codigo_unico']) ? trim($_GET['codigo_unico']) : '';
|
||||||
|
$unidad_info = null;
|
||||||
|
$error_message = '';
|
||||||
|
|
||||||
|
if (!empty($codigo_unico_buscado)) {
|
||||||
|
try {
|
||||||
|
$db = db();
|
||||||
|
$stmt = $db->prepare(
|
||||||
|
"\n SELECT
|
||||||
|
ui.codigo_unico,
|
||||||
|
ui.estado,
|
||||||
|
ui.fecha_creacion,
|
||||||
|
ui.fecha_ingreso,
|
||||||
|
ui.fecha_salida,
|
||||||
|
ui.pedido_id,
|
||||||
|
p.nombre AS producto_nombre,
|
||||||
|
p.sku AS producto_sku
|
||||||
|
FROM unidades_inventario ui
|
||||||
|
JOIN products p ON ui.producto_id = p.id
|
||||||
|
WHERE ui.codigo_unico = :codigo_unico
|
||||||
|
");
|
||||||
|
$stmt->bindParam(':codigo_unico', $codigo_unico_buscado, PDO::PARAM_STR);
|
||||||
|
$stmt->execute();
|
||||||
|
$unidad_info = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
if (!$unidad_info) {
|
||||||
|
$error_message = "No se encontró ninguna unidad de inventario con el código \"" . htmlspecialchars($codigo_unico_buscado) . "\".";
|
||||||
|
}
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
$error_message = "Error en la base de datos: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="container mt-4">
|
||||||
|
<h1 class="mb-4">Buscador de Unidades de Inventario</h1>
|
||||||
|
<p>Ingresa o escanea el código de barras de una unidad individual para ver su historial y estado actual.</p>
|
||||||
|
|
||||||
|
<div class="card shadow-sm mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="buscador_inventario.php" method="GET" class="mb-3">
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" class="form-control form-control-lg" id="codigo_unico" name="codigo_unico" placeholder="Ej: AFS-0035" value="<?php echo htmlspecialchars($codigo_unico_buscado); ?>" required autofocus>
|
||||||
|
<button class="btn btn-primary" type="submit">
|
||||||
|
<i class="fas fa-search"></i> Buscar
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if ($error_message): ?>
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
<?php echo $error_message; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($unidad_info): ?>
|
||||||
|
<div class="card shadow-sm">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="mb-0">Resultados para: <?php echo htmlspecialchars($unidad_info['codigo_unico']); ?></h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<h4>Información del Producto</h4>
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr>
|
||||||
|
<th style="width: 30%;">Nombre</th>
|
||||||
|
<td><?php echo htmlspecialchars($unidad_info['producto_nombre']); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>SKU</th>
|
||||||
|
<td><?php echo htmlspecialchars($unidad_info['producto_sku']); ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<h4>Trazabilidad de la Unidad</h4>
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tr>
|
||||||
|
<th style="width: 30%;">Estado Actual</th>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
$estado = htmlspecialchars($unidad_info['estado']);
|
||||||
|
$badge_class = 'secondary';
|
||||||
|
if ($estado == 'En Almacén') $badge_class = 'success';
|
||||||
|
if ($estado == 'Vendido') $badge_class = 'danger';
|
||||||
|
if ($estado == 'Generado') $badge_class = 'info';
|
||||||
|
echo "<span class=\"badge bg-$badge_class\">$estado</span>";
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Pedido ID</th>
|
||||||
|
<td>
|
||||||
|
<?php if ($unidad_info['pedido_id']): ?>
|
||||||
|
<a href="info_producto.php?id=<?php echo $unidad_info['pedido_id']; // Asumiendo que esta es la página de detalle de pedido ?>">
|
||||||
|
<?php echo $unidad_info['pedido_id']; ?>
|
||||||
|
</a>
|
||||||
|
<?php else: ?>
|
||||||
|
N/A
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h4>Historial de Fechas</h4>
|
||||||
|
<table class="table table-sm table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Creación (Etiqueta)</th>
|
||||||
|
<th>Ingreso a Almacén</th>
|
||||||
|
<th>Salida (Venta)</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo $unidad_info['fecha_creacion'] ? date('d/m/Y H:i:s', strtotime($unidad_info['fecha_creacion'])) : 'N/A'; ?></td>
|
||||||
|
<td><?php echo $unidad_info['fecha_ingreso'] ? date('d/m/Y H:i:s', strtotime($unidad_info['fecha_ingreso'])) : 'N/A'; ?></td>
|
||||||
|
<td><?php echo $unidad_info['fecha_salida'] ? date('d/m/Y H:i:s', strtotime($unidad_info['fecha_salida'])) : 'N/A'; ?></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php require_once 'layout_footer.php'; ?>
|
||||||
@ -97,6 +97,12 @@ $navItems = [
|
|||||||
'text' => 'Inventario General',
|
'text' => 'Inventario General',
|
||||||
'roles' => ['Administrador', 'admin', 'Control Logistico']
|
'roles' => ['Administrador', 'admin', 'Control Logistico']
|
||||||
],
|
],
|
||||||
|
'buscador_inventario' => [
|
||||||
|
'url' => 'buscador_inventario.php',
|
||||||
|
'icon' => 'fa-search-dollar',
|
||||||
|
'text' => 'Buscador de Unidades',
|
||||||
|
'roles' => ['Administrador', 'admin', 'Control Logistico', 'Asesor', 'Soporte Logistico']
|
||||||
|
],
|
||||||
'inventario_por_sede' => [
|
'inventario_por_sede' => [
|
||||||
'url' => 'inventario_por_sede.php',
|
'url' => 'inventario_por_sede.php',
|
||||||
'icon' => 'fa-search-location',
|
'icon' => 'fa-search-location',
|
||||||
|
|||||||