style(pos): redimensionar filtros de preordenes y compactar tarjetas de ordenes en un 28%

This commit is contained in:
unknown
2026-10-08 11:56:31 -06:00
parent 2b1b3f418c
commit 6f0cb55658
4 changed files with 169 additions and 108 deletions
+35 -35
View File
@@ -1497,10 +1497,10 @@ function renderPreOrdersList() {
if (filtered.length === 0) {
if (currentPreOrderFilter === 'canceladas') {
list.innerHTML = `
<div style="text-align: center; color: #64748b; padding: 40px 20px; background: white; border-radius: 14px; border: 1.5px dashed #cbd5e1; margin-top: 4px;">
<span style="font-size: 2.2rem; display: block; margin-bottom: 8px;">✅</span>
<strong style="color: #334155; font-size: 0.95rem; display: block;">No hay pre-órdenes canceladas</strong>
<p style="font-size: 0.8rem; margin: 4px 0 0 0; color: #94a3b8;">Las órdenes no retiradas que se cancelen por Cierre de Caja o a las 5:00 PM aparecerán aquí con su monto liberado.</p>
<div style="text-align: center; color: #64748b; padding: 24px 16px; background: white; border-radius: 11px; border: 1.5px dashed #cbd5e1; margin-top: 2px;">
<span style="font-size: 1.6rem; display: block; margin-bottom: 6px;">✅</span>
<strong style="color: #334155; font-size: 0.88rem; display: block;">No hay pre-órdenes canceladas</strong>
<p style="font-size: 0.75rem; margin: 3px 0 0 0; color: #94a3b8;">Las órdenes no retiradas que se cancelen por Cierre de Caja o a las 5:00 PM aparecerán aquí con su monto liberado.</p>
</div>
`;
return;
@@ -1508,15 +1508,15 @@ function renderPreOrdersList() {
const filterNames = {
'todos': 'pendientes por entregar',
'recreo_1': 'para el 1er Recreo (9:30 AM)',
'almuerzo': 'para el Almuerzo (11:45 AM)',
'recreo_2': 'para el 2do Recreo (1:45 PM)'
'recreo_1': 'para el 1er Recreo',
'almuerzo': 'para el Almuerzo',
'recreo_2': 'para el 2do Recreo'
};
list.innerHTML = `
<div style="text-align: center; color: #64748b; padding: 40px 20px; background: white; border-radius: 14px; border: 1.5px dashed #cbd5e1; margin-top: 4px;">
<span style="font-size: 2.2rem; display: block; margin-bottom: 8px;">🥪</span>
<strong style="color: #334155; font-size: 0.95rem; display: block;">No hay pre-órdenes ${filterNames[currentPreOrderFilter] || 'pendientes'}</strong>
<p style="font-size: 0.8rem; margin: 4px 0 0 0; color: #94a3b8;">Las órdenes programadas para este horario aparecerán aquí automáticamente.</p>
<div style="text-align: center; color: #64748b; padding: 24px 16px; background: white; border-radius: 11px; border: 1.5px dashed #cbd5e1; margin-top: 2px;">
<span style="font-size: 1.6rem; display: block; margin-bottom: 6px;">🥪</span>
<strong style="color: #334155; font-size: 0.88rem; display: block;">No hay pre-órdenes ${filterNames[currentPreOrderFilter] || 'pendientes'}</strong>
<p style="font-size: 0.75rem; margin: 3px 0 0 0; color: #94a3b8;">Las órdenes programadas para este horario aparecerán aquí automáticamente.</p>
</div>
`;
return;
@@ -1531,29 +1531,29 @@ function renderPreOrdersList() {
const isDelivered = ord.estado === 'entregado';
return `
<div class="pos-preorder-card" style="border-left: 6px solid ${isCanceled ? '#ef4444' : badge.border}; ${isCanceled ? 'opacity: 0.94; background: #fffbfa;' : ''}">
<div class="pos-preorder-card" style="border-left: 4px solid ${isCanceled ? '#ef4444' : badge.border}; ${isCanceled ? 'opacity: 0.94; background: #fffbfa;' : ''}">
<!-- Banner Superior de Horario Programado o Estado -->
<div class="pos-preorder-badge-banner" style="background: ${isCanceled ? '#fef2f2' : badge.bg}; border: 1.5px solid ${isCanceled ? '#fecaca' : badge.badgeBorder}; color: ${isCanceled ? '#991b1b' : badge.text};">
<div style="display: flex; align-items: center; gap: 8px;">
<span style="font-size: 1.3rem;">${isCanceled ? '🚫' : badge.icon}</span>
<div class="pos-preorder-badge-banner" style="background: ${isCanceled ? '#fef2f2' : badge.bg}; border: 1px solid ${isCanceled ? '#fca5a5' : badge.badgeBorder}; color: ${isCanceled ? '#991b1b' : badge.text};">
<div style="display: flex; align-items: center; gap: 6px;">
<span style="font-size: 1.05rem;">${isCanceled ? '🚫' : badge.icon}</span>
<div>
<span style="font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.85; display: block; font-weight: 800;">${isCanceled ? 'ESTADO:' : 'ALISTAR PARA:'}</span>
<strong style="font-size: 0.96rem; letter-spacing: -0.2px;">${isCanceled ? 'Pre-orden Cancelada (No Retirada)' : badge.full}</strong>
<span style="font-size: 0.60rem; text-transform: uppercase; letter-spacing: 0.4px; opacity: 0.85; display: block; font-weight: 800; line-height: 1;">${isCanceled ? 'ESTADO:' : 'ALISTAR PARA:'}</span>
<strong style="font-size: 0.80rem; letter-spacing: -0.1px; line-height: 1.2;">${isCanceled ? 'Pre-orden Cancelada (No Retirada)' : badge.full}</strong>
</div>
</div>
<div style="display: flex; align-items: center; gap: 6px;">
<div style="display: flex; align-items: center; gap: 5px;">
${isCanceled
? '<span class="saas-status-badge" style="padding: 4px 10px; background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-weight: 800;"><span class="saas-dot" style="background: #ef4444;"></span>Cancelada</span>'
? '<span class="saas-status-badge" style="padding: 2px 7px; font-size: 0.68rem; background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; font-weight: 800;"><span class="saas-dot" style="background: #ef4444; width: 5px; height: 5px;"></span>Cancelada</span>'
: isDelivered
? '<span class="saas-status-badge saas-status-active" style="padding: 4px 10px; font-weight: 800;"><span class="saas-dot"></span>Entregado</span>'
: '<span class="saas-status-badge saas-status-pending" style="padding: 4px 10px; background: #fef08a; color: #854d0e; border: 1px solid #fde047; font-weight: 800;"><span class="saas-dot" style="background: #eab308;"></span>Pendiente Alistar</span>'
? '<span class="saas-status-badge saas-status-active" style="padding: 2px 7px; font-size: 0.68rem; font-weight: 800;"><span class="saas-dot" style="width: 5px; height: 5px;"></span>Entregado</span>'
: '<span class="saas-status-badge saas-status-pending" style="padding: 2px 7px; font-size: 0.68rem; background: #fef08a; color: #854d0e; border: 1px solid #fde047; font-weight: 800;"><span class="saas-dot" style="background: #eab308; width: 5px; height: 5px;"></span>Pendiente</span>'
}
</div>
</div>
<div class="pos-preorder-header" style="margin-top: 2px;">
<div class="pos-preorder-header">
<div class="pos-preorder-student">
<div class="pos-preorder-avatar" style="display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.9rem; background: ${isCanceled ? '#94a3b8' : 'linear-gradient(135deg, #0284c7, #0369a1)'}; color: #ffffff;">
<div class="pos-preorder-avatar" style="display: flex; align-items: center; justify-content: center; font-weight: 900; background: ${isCanceled ? '#94a3b8' : 'linear-gradient(135deg, #0284c7, #0369a1)'}; color: #ffffff;">
${getStudentInitials(ord.estudiante_nombre)}
</div>
<div>
@@ -1561,7 +1561,7 @@ function renderPreOrdersList() {
<strong class="pos-preorder-name" style="${isCanceled ? 'color: #475569;' : ''}">${ord.estudiante_nombre}</strong>
<span class="pos-preorder-grade">${ord.grado} • ${ord.seccion}</span>
</div>
<div class="pos-preorder-ticket-info" style="display: flex; align-items: center; gap: 6px; flex-wrap: wrap;">
<div class="pos-preorder-ticket-info" style="display: flex; align-items: center; gap: 5px; flex-wrap: wrap;">
<span>Ticket: <strong>${ord.codigo_orden}</strong></span>
<span>•</span>
<span>Pedido: ${hora}</span>
@@ -1573,41 +1573,41 @@ function renderPreOrdersList() {
</div>
${ord.observaciones ? `
<div style="background: ${isCanceled ? '#fee2e2' : '#f8fafc'}; border: 1px solid ${isCanceled ? '#fca5a5' : '#e2e8f0'}; color: ${isCanceled ? '#991b1b' : '#475569'}; padding: 6px 10px; border-radius: 8px; font-size: 0.78rem; font-weight: 700;">
<div style="background: ${isCanceled ? '#fee2e2' : '#f8fafc'}; border: 1px solid ${isCanceled ? '#fca5a5' : '#e2e8f0'}; color: ${isCanceled ? '#991b1b' : '#475569'}; padding: 4px 8px; border-radius: 6px; font-size: 0.70rem; font-weight: 700; line-height: 1.25;">
ℹ️ ${ord.observaciones}
</div>
` : (ord.notas ? `
<div style="background: #fef3c7; border: 1px solid #fde68a; color: #92400e; padding: 6px 10px; border-radius: 8px; font-size: 0.78rem; font-weight: 700;">
<div style="background: #fef3c7; border: 1px solid #fde68a; color: #92400e; padding: 4px 8px; border-radius: 6px; font-size: 0.70rem; font-weight: 700; line-height: 1.25;">
📝 Nota del pedido: ${ord.notas}
</div>
` : '')}
<div class="pos-preorder-items-box" style="display: flex; align-items: center; gap: 8px;">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="${isCanceled ? '#94a3b8' : '#0284c7'}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="flex-shrink: 0;"><path d="m7.5 4.27 9 5.15"/><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>
<div class="pos-preorder-items-box">
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="${isCanceled ? '#94a3b8' : '#0284c7'}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="flex-shrink: 0;"><path d="m7.5 4.27 9 5.15"/><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg>
<span style="flex: 1; word-break: break-word; ${isCanceled ? 'color: #64748b; text-decoration: line-through;' : ''}">${itemsList}</span>
</div>
<div class="pos-preorder-footer">
<div class="pos-preorder-total">
<span class="pos-preorder-total-label">${isCanceled ? 'Monto Liberado al Alumno:' : (isDelivered ? 'Total Cobrado:' : 'Total a Cobrar (Monto Flotante):')}</span>
<span class="pos-preorder-total-label">${isCanceled ? 'Monto Liberado:' : (isDelivered ? 'Total Cobrado:' : 'Total a Cobrar (Flotante):')}</span>
<strong class="pos-preorder-total-val" style="${isCanceled ? 'color: #10b981;' : ''}">₡${ord.total_colones.toLocaleString('es-CR')}</strong>
</div>
<div>
${isCanceled ? `
<span class="saas-status-badge" style="padding: 6px 12px; font-size: 0.8rem; background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; font-weight: 800;">
<span class="saas-status-badge" style="padding: 2px 8px; font-size: 0.70rem; background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; font-weight: 800; border-radius: 6px;">
Saldo devuelto al disponible
</span>
` : (isDelivered ? `
<span class="saas-status-badge saas-status-active" style="padding: 6px 12px; font-size: 0.8rem;">
<span class="saas-dot"></span>Cobrado y Entregado
<span class="saas-status-badge saas-status-active" style="padding: 2px 8px; font-size: 0.70rem; border-radius: 6px;">
<span class="saas-dot" style="width: 5px; height: 5px;"></span>Cobrado y Entregado
</span>
` : `
<div style="display: flex; gap: 6px; align-items: center;">
<div style="display: flex; gap: 5px; align-items: center;">
<button onclick="updateOrderStatus(${ord.id}, 'entregado')" class="btn-saas pos-btn-entregar" title="Cobrar y entregar pedido al estudiante">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
<span>Cobrar y Entregar</span>
</button>
<button type="button" onclick="cancelarPreordenManual(${ord.id})" class="btn-saas" style="padding: 6px 10px; font-size: 0.76rem; font-weight: 700; color: #dc2626; background: #fef2f2; border: 1.5px solid #fecaca; border-radius: 8px; cursor: pointer;" title="Cancelar pre-orden y liberar saldo flotante al estudiante">
<button type="button" onclick="cancelarPreordenManual(${ord.id})" class="btn-saas" style="padding: 4px 8px; font-size: 0.70rem; font-weight: 700; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; cursor: pointer;" title="Cancelar pre-orden y liberar saldo flotante al estudiante">
✕ Cancelar
</button>
</div>