diff --git a/assets/css/style.css b/assets/css/style.css index ba06515..d62ae85 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -104,6 +104,17 @@ body { body.sidebar-active .content { margin-left: 260px; } + + .sidebar .nav { + display: flex; + overflow-x: auto; + white-space: nowrap; + -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */ + } + + .sidebar .nav-item { + flex-basis: auto; /* Allow items to take their natural width */ + } } @@ -293,4 +304,26 @@ h1, .h1 { .sidebar .submenu .nav-link.active { color: #fff; /* White color for active sub-item */ font-weight: bold; +} + +@media (max-width: 767px) { + .content { + padding: 15px; + } + + .card-header, .card-body { + padding: 1rem; + } + + h1, .h1 { + font-size: 1.75rem; + } + + .table { + font-size: 0.9rem; + } + + .table td, .table th { + padding: 0.5rem; + } } \ No newline at end of file diff --git a/assets/uploads/vouchers/698de35a83aff-CAPTURA 3.png b/assets/uploads/vouchers/698de35a83aff-CAPTURA 3.png new file mode 100644 index 0000000..b785aa4 Binary files /dev/null and b/assets/uploads/vouchers/698de35a83aff-CAPTURA 3.png differ diff --git a/assets/uploads/vouchers/698de4145d43c-CAPTURA 4.png b/assets/uploads/vouchers/698de4145d43c-CAPTURA 4.png new file mode 100644 index 0000000..0b22f07 Binary files /dev/null and b/assets/uploads/vouchers/698de4145d43c-CAPTURA 4.png differ diff --git a/assets/uploads/vouchers/698de60f82358-WhatsApp Image 2026-02-12 at 9.34.18 AM.jpeg b/assets/uploads/vouchers/698de60f82358-WhatsApp Image 2026-02-12 at 9.34.18 AM.jpeg new file mode 100644 index 0000000..88ae65a Binary files /dev/null and b/assets/uploads/vouchers/698de60f82358-WhatsApp Image 2026-02-12 at 9.34.18 AM.jpeg differ diff --git a/assets/uploads/vouchers/698ded43bcdce-ENTREGADO.png b/assets/uploads/vouchers/698ded43bcdce-ENTREGADO.png new file mode 100644 index 0000000..ae215bb Binary files /dev/null and b/assets/uploads/vouchers/698ded43bcdce-ENTREGADO.png differ diff --git a/db/migrations/062_create_unidades_inventario_table.sql b/db/migrations/062_create_unidades_inventario_table.sql new file mode 100644 index 0000000..2e66aea --- /dev/null +++ b/db/migrations/062_create_unidades_inventario_table.sql @@ -0,0 +1,12 @@ +CREATE TABLE IF NOT EXISTS `unidades_inventario` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `codigo_unico` VARCHAR(255) NOT NULL UNIQUE, + `producto_id` INT NOT NULL, + `estado` VARCHAR(50) NOT NULL DEFAULT 'Generado', -- Puede ser 'Generado', 'En Almacén', 'Vendido' + `fecha_creacion` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `fecha_ingreso` DATETIME DEFAULT NULL, + `fecha_salida` DATETIME DEFAULT NULL, + `pedido_id` INT DEFAULT NULL, + FOREIGN KEY (`producto_id`) REFERENCES `products`(`id`) ON DELETE CASCADE, + FOREIGN KEY (`pedido_id`) REFERENCES `pedidos`(`id`) ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/generar_etiquetas.php b/generar_etiquetas.php new file mode 100644 index 0000000..260c84d --- /dev/null +++ b/generar_etiquetas.php @@ -0,0 +1,97 @@ +query("SELECT id, nombre FROM products ORDER BY nombre ASC"); + $products = $stmt->fetchAll(PDO::FETCH_ASSOC); +} catch (PDOException $e) { + $_SESSION['error_message'] = "Error al cargar los productos: " . $e->getMessage(); +} + +$generated_codes = []; +// Handle form submission +if ($_SERVER['REQUEST_METHOD'] === 'POST') { + $producto_id = $_POST['producto_id'] ?? null; + $cantidad = isset($_POST['cantidad']) ? (int)$_POST['cantidad'] : 0; + + if ($producto_id && $cantidad > 0 && $cantidad <= 1000) { + $db = db(); + try { + $db->beginTransaction(); + + // Prepare statement for insertion + $stmt = $db->prepare("INSERT INTO unidades_inventario (codigo_unico, producto_id) VALUES (?, ?)"); + + for ($i = 0; $i < $cantidad; $i++) { + // Generate a more robust unique code + $unique_code = 'FL-' . $producto_id . '-' . strtoupper(uniqid()); + + $stmt->execute([$unique_code, $producto_id]); + $generated_codes[] = $unique_code; + } + + $db->commit(); + $_SESSION['success_message'] = 'Se generaron ' . count($generated_codes) . ' códigos exitosamente.'; + + } catch (PDOException $e) { + $db->rollBack(); + $_SESSION['error_message'] = 'Error al generar los códigos: ' . $e->getMessage(); + } + } else { + $_SESSION['error_message'] = 'Por favor, seleccione un producto y especifique una cantidad válida (entre 1 y 1000).'; + } +} +?> + +
Guarda estos códigos para imprimirlos y pegarlos en tus paquetes.
+ + +