From 9f3daff09b3ad6e0fb23eb27357d8cbdf73e2339 Mon Sep 17 00:00:00 2001 From: Marco Gallegos Date: Tue, 9 Sep 2025 16:18:51 -0600 Subject: [PATCH] fix: Remove clear form button and improve UX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Major UI/UX improvements and bug fixes: • Fixed date formatting bug in ticket receipts (undefined dates) • Removed clear form button per user request • Added favicon integration across all pages (apple-touch-icon, favicon variants) • Implemented auto-collapse for product categories after adding items • Changed all ticket content alignment to left for better readability • Made product interface more compact to reduce scrolling • Enhanced date validation and formatting throughout the system Technical changes: - Fixed esc() function regex that was causing date corruption - Added collapseAllCategories() function for better UX - Updated cache-busting versions for proper browser refresh - Improved date handling with proper validation - Added comprehensive favicon support with web manifest 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- app.js | 30 +- cookies.txt | 4 + index.html | 14 +- index_backup.html | 876 +++++++++++++++++++++++++ login.html | 6 + print.js | 58 +- setup.html | 6 + src/favicon/android-chrome-192x192.png | Bin 0 -> 15070 bytes src/favicon/android-chrome-512x512.png | Bin 0 -> 66367 bytes src/favicon/apple-touch-icon.png | Bin 0 -> 13515 bytes src/favicon/favicon-16x16.png | Bin 0 -> 512 bytes src/favicon/favicon-32x32.png | Bin 0 -> 1128 bytes src/favicon/favicon.ico | Bin 0 -> 15406 bytes src/favicon/site.webmanifest | 1 + styles.css | 52 +- 15 files changed, 1001 insertions(+), 46 deletions(-) create mode 100644 cookies.txt create mode 100644 index_backup.html create mode 100644 src/favicon/android-chrome-192x192.png create mode 100644 src/favicon/android-chrome-512x512.png create mode 100644 src/favicon/apple-touch-icon.png create mode 100644 src/favicon/favicon-16x16.png create mode 100644 src/favicon/favicon-32x32.png create mode 100644 src/favicon/favicon.ico create mode 100644 src/favicon/site.webmanifest diff --git a/app.js b/app.js index 801fed3..9dcd195 100644 --- a/app.js +++ b/app.js @@ -1,4 +1,4 @@ -import { renderTicketAndPrint } from './print.js?v=1757039803'; +import { renderTicketAndPrint } from './print.js?v=1757454000'; // --- GLOBAL VARIABLES --- const defaultSettings = { @@ -43,7 +43,16 @@ function construirFechaCita() { // Convertir de formato ISO (YYYY-MM-DD) a formato DD/MM/YYYY const dateParts = fechaPicker.value.split('-'); - return `${dateParts[2]}/${dateParts[1]}/${dateParts[0]}`; + if (dateParts.length !== 3) return ''; + + const year = dateParts[0]; + const month = dateParts[1]; + const day = dateParts[2]; + + // Validar que todas las partes existan + if (!year || !month || !day) return ''; + + return `${day.padStart(2, '0')}/${month.padStart(2, '0')}/${year}`; } // Actualizar horarios disponibles basados en la fecha seleccionada @@ -2312,6 +2321,19 @@ function toggleCategory(event) { } } +function collapseAllCategories() { + const categorySections = document.querySelectorAll('.category-section'); + categorySections.forEach(section => { + const productsGrid = section.querySelector('.products-grid'); + const toggle = section.querySelector('.category-toggle'); + if (productsGrid && toggle) { + productsGrid.style.display = 'none'; + toggle.textContent = '▶'; + section.classList.add('collapsed'); + } + }); +} + async function loadProductsByCategories() { try { const response = await fetch('/api/products'); @@ -2451,6 +2473,9 @@ function addProductToCart(productId) { updateCartDisplay(); calculateTotals(); + + // Auto-collapse all categories after adding product + collapseAllCategories(); } function removeProductFromCart(productId) { @@ -3169,4 +3194,5 @@ function addAnticipo() { alert(`✅ ANTICIPO AGREGADO\n\n${anticipoName}: $${amount.toFixed(2)}`); } + document.addEventListener('DOMContentLoaded', initializeApp); diff --git a/cookies.txt b/cookies.txt new file mode 100644 index 0000000..c31d989 --- /dev/null +++ b/cookies.txt @@ -0,0 +1,4 @@ +# Netscape HTTP Cookie File +# https://curl.se/docs/http-cookies.html +# This file was generated by libcurl! Edit at your own risk. + diff --git a/index.html b/index.html index 3bcaab2..d1c2618 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,12 @@ Ale Ponce | AlMa - - + + + + + + @@ -338,10 +342,6 @@ 🎫 Generar Venta - @@ -768,6 +768,6 @@
- + \ No newline at end of file diff --git a/index_backup.html b/index_backup.html new file mode 100644 index 0000000..909d844 --- /dev/null +++ b/index_backup.html @@ -0,0 +1,876 @@ + + + + + + Ale Ponce | AlMa + + + + + + + + + + + + +
+
+ + + + +
+ + +
+
+

Dashboard

+
+
+

Ingresos Totales

+

$0.00

+
+
+

Servicios Realizados

+

0

+
+
+
+
+

Ingresos por Servicio

+ +
+
+

Ingresos por Método de Pago

+ +
+
+
+

Próximas Citas

+
+ +
+
+
+
+ + +
+
+ +
+

💰 Nueva Venta

+
+ 0 productos + $0.00 +
+
+ +
+ +
+ +
+
+ + + +
+
+ + +
+

Selecciona tus servicios

+ + +
+
+ 👁️ +

Pestañas

+ +
+
+ +
+
+ + +
+
+ ✏️ +

Microblading & Cejas

+ +
+
+ +
+
+ + +
+
+ 💅 +

Nail Art

+ +
+
+ +
+
+
+
+ + +
+ +
+

🛒 Carrito de Compras

+
+
+ 🛒 +

Selecciona servicios para comenzar

+
+
+
+ + +
+
+ + +
+ +
+ + + + + +
+

📅 Datos de la Cita

+
+ + +
+
+ + +
+
+
+ Subtotal: + $0.00 +
+ +
+ TOTAL: + $0.00 +
+
+
+ + +
+

💳 Método de Pago

+
+ + + +
+
+ + +
+

📝 Notas Adicionales

+ +
+ + +
+ + +
+ + +
+
+ +
+
+
+ + +
+

Movimientos Recientes

+ +
+ +
+
+ + +
+
+ + + +
+
+ + + +
+

Venta

+
+
+ + + + +
+
+
+
+ + +
+
+ + +
+ +
+ + + + + +
+
+ + +
+
+ + +
+
+ +
+ + +
+ + +
+
+ Subtotal: + $0.00 +
+ +
+ Total: + $0.00 +
+
+ + + + + + +
+ + +
+ + + +
+

Movimientos Recientes

+ +
+
+ + + + + + + + + + + + +
FolioFechaCitaClienteServicioMontoAcciones
+
+
+
+ + +
+
+ + +
+ + +
+
+

Registrar Nuevo Cliente

+
+ +
+ + + + + + + + + + + + +
+ + +
+ +
+ + +
+
+ + + + +
+

Cursos Registrados

+
+ +
+ +
+ + +
+
+
+
+ + +
+
+
+
+

Lista de Clientes

+ +
+ + + + + + + + +
NombreTeléfono
+
+
+
+

Expediente del Cliente

+ +
+

Selecciona un cliente de la lista para ver su expediente.

+
+
+
+
+
+
+ + +
+
+

Gestión de Productos, Servicios y Anticipos

+ + + +
+

Añadir/Editar Producto

+
+ +
+ + + + + + +
+ + +
+ + + +
+
+
+ +
+ + +
+

Todos los Productos + +

+

+ Nota: Esta tabla muestra solo productos reales (servicios y cursos). + Los anticipos se manejan únicamente en notas de ventas y en la app de citas. +

+
+ + + + + + + + + + + + + +
+ Folio + + Fecha + + Cita + + Descripción + + Categoría + PrecioAcciones
+
+
+ + + + +
+
+ + +
+
+

Solicitudes de Cancelación

+

Aquí puedes revisar y gestionar las solicitudes de cancelación de ventas enviadas por los usuarios.

+ +
+ + + + + + + + + + + + + + +
FolioClienteMontoSolicitado porFecha SolicitudMotivoEstadoAcciones
+
+ + +
+
+ + +
+
+

Configuración del Negocio

+
+
+ + + + + + + + +
+
+ + +
+
+
+
+

Mis Credenciales

+
+
+ + + + + + +
+
+ +
+
+
+ + +
+

Ubicación y Exportación de Datos + +

+ +
+
+ +
+ +
+
+ +
+ + + + + \ No newline at end of file diff --git a/login.html b/login.html index 9e9ca44..b425a80 100644 --- a/login.html +++ b/login.html @@ -4,6 +4,12 @@ Ale Ponce | AlMa + + + + + +