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 + + + + + +