mirror of
https://github.com/marcogll/ap_pos.git
synced 2026-01-13 13:15:16 +00:00
fix: Remove clear form button and improve UX
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 <noreply@anthropic.com>
This commit is contained in:
30
app.js
30
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);
|
||||
|
||||
Reference in New Issue
Block a user