Autosave: 20260212-175210

This commit is contained in:
Flatlogic Bot 2026-02-12 17:52:11 +00:00
parent 914c98e457
commit 304de737e6
66 changed files with 151 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

145
buscador_inventario.php Normal file
View 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'; ?>

View File

@ -97,6 +97,12 @@ $navItems = [
'text' => 'Inventario General',
'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' => [
'url' => 'inventario_por_sede.php',
'icon' => 'fa-search-location',