feat(padres): agregar opcion Ver motivo con modal explicativo para recargas SINPE rechazadas
This commit is contained in:
+68
-3
@@ -12,7 +12,7 @@
|
|||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
<meta name="apple-mobile-web-app-title" content="SiboPay">
|
<meta name="apple-mobile-web-app-title" content="SiboPay">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<link rel="stylesheet" href="/css/styles.css?v=13.6">
|
<link rel="stylesheet" href="/css/styles.css?v=13.7">
|
||||||
<link rel="stylesheet" href="/css/desktop.css?v=2.2">
|
<link rel="stylesheet" href="/css/desktop.css?v=2.2">
|
||||||
<style>
|
<style>
|
||||||
/* Transiciones suaves */
|
/* Transiciones suaves */
|
||||||
@@ -3341,6 +3341,71 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- MODAL: VER MOTIVO DE RECHAZO SINPE (PORTAL DE PADRES) -->
|
||||||
|
<div class="modal-qr-backdrop" id="modalParentVerMotivoRechazo" style="display: none; z-index: 99999;" onclick="cerrarModalParentMotivoRechazo(event)">
|
||||||
|
<div class="modal-qr-card" onclick="event.stopPropagation()" style="max-width: 440px; text-align: left; padding: 22px; border-radius: 18px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.2);">
|
||||||
|
|
||||||
|
<!-- Encabezado -->
|
||||||
|
<div style="display: flex; align-items: center; justify-content: space-between; border-bottom: 1.5px solid var(--border, #e2e8f0); padding-bottom: 10px; margin-bottom: 14px;">
|
||||||
|
<div style="display: flex; align-items: center; gap: 10px;">
|
||||||
|
<div style="width: 36px; height: 36px; border-radius: 10px; background: #fee2e2; color: #dc2626; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0;">
|
||||||
|
🚫
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3 style="margin: 0; font-size: 1.05rem; font-weight: 900; color: #991b1b;">Recarga No Acreditada</h3>
|
||||||
|
<span style="font-size: 0.72rem; color: var(--text-muted, #64748b);">Detalle del rechazo reportado por la soda</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="button" onclick="cerrarModalParentMotivoRechazo()" style="background: none; border: none; font-size: 1.3rem; color: var(--text-muted, #64748b); cursor: pointer; padding: 4px;" title="Cerrar">✕</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Resumen de Solicitud -->
|
||||||
|
<div style="background: rgba(148, 163, 184, 0.08); border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 0.80rem; line-height: 1.45;">
|
||||||
|
<div style="display: flex; justify-content: space-between;">
|
||||||
|
<span style="color: var(--text-muted, #64748b);">Estudiante:</span>
|
||||||
|
<strong id="parentMotivoEstudiante" style="color: var(--text-main, #0f172a);">-</strong>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; justify-content: space-between; margin-top: 3px;">
|
||||||
|
<span style="color: var(--text-muted, #64748b);">Monto Solicitado:</span>
|
||||||
|
<strong id="parentMotivoMonto" style="color: #0284c7; font-size: 0.92rem;">₡0</strong>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; justify-content: space-between; margin-top: 3px;">
|
||||||
|
<span style="color: var(--text-muted, #64748b);">Referencia / Cód:</span>
|
||||||
|
<strong id="parentMotivoComprobante" style="color: var(--text-main, #334155); font-family: monospace;">-</strong>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; justify-content: space-between; margin-top: 3px;">
|
||||||
|
<span style="color: var(--text-muted, #64748b);">Fecha de Solicitud:</span>
|
||||||
|
<span id="parentMotivoFecha" style="color: var(--text-muted, #64748b); font-size: 0.76rem;">-</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Caja del Motivo de Rechazo -->
|
||||||
|
<div style="background: #fff1f2; border: 1.5px solid #fecdd3; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;">
|
||||||
|
<div style="font-size: 0.72rem; font-weight: 800; color: #be123c; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 5px;">
|
||||||
|
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
|
||||||
|
<span>Motivo indicado por la soda:</span>
|
||||||
|
</div>
|
||||||
|
<div id="parentMotivoTexto" style="font-size: 0.88rem; font-weight: 800; color: #991b1b; margin-top: 5px; line-height: 1.45;">
|
||||||
|
Fondos no verificados en la cuenta bancaria de la soda.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Guía y Orientación para el Padre -->
|
||||||
|
<div style="font-size: 0.74rem; color: #64748b; line-height: 1.42; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; margin-bottom: 16px;">
|
||||||
|
<span style="font-size: 1rem; line-height: 1.1;">ℹ️</span>
|
||||||
|
<span>
|
||||||
|
Si realizaste la transferencia correctamente desde tu banco, por favor comunícate con la administración de la soda escolar y presenta el comprobante oficial para su verificación manual.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Botón de Cerrar -->
|
||||||
|
<button type="button" onclick="cerrarModalParentMotivoRechazo()" class="btn-saas btn-saas-primary" style="width: 100%; height: 38px; font-weight: 800; font-size: 0.88rem; justify-content: center; cursor: pointer;">
|
||||||
|
Entendido
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- BARRA DE NAVEGACIÓN INFERIOR PWA (MÓVILES) -->
|
<!-- BARRA DE NAVEGACIÓN INFERIOR PWA (MÓVILES) -->
|
||||||
<nav class="pwa-bottom-nav" id="pwaBottomNav" style="display: none;">
|
<nav class="pwa-bottom-nav" id="pwaBottomNav" style="display: none;">
|
||||||
<button class="pwa-nav-item active" id="pwaNavMenu" onclick="pwaNavigateTo('menu')">
|
<button class="pwa-nav-item active" id="pwaNavMenu" onclick="pwaNavigateTo('menu')">
|
||||||
@@ -3365,10 +3430,10 @@
|
|||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<script src="/js/dialogs.js?v=13.6"></script>
|
<script src="/js/dialogs.js?v=13.7"></script>
|
||||||
<script src="/js/sounds.js?v=9.6"></script>
|
<script src="/js/sounds.js?v=9.6"></script>
|
||||||
<script src="/js/jsQR.js"></script>
|
<script src="/js/jsQR.js"></script>
|
||||||
<script src="/js/food-icons.js?v=1.1"></script>
|
<script src="/js/food-icons.js?v=1.1"></script>
|
||||||
<script src="/js/app.js?v=13.6"></script>
|
<script src="/js/app.js?v=13.7"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+23
-4
@@ -1736,15 +1736,25 @@ function renderParentHistory() {
|
|||||||
fecha = new Date(t.fecha).toLocaleDateString('es-CR', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
|
fecha = new Date(t.fecha).toLocaleDateString('es-CR', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|
||||||
|
const safeDesc = (t.descripcion || '').replace(/"/g, '"').replace(/'/g, ''');
|
||||||
|
const safeComp = (t.comprobante_sinpe || '').replace(/"/g, '"').replace(/'/g, ''');
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<div style="display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f1f5f9;">
|
<div style="display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f1f5f9; align-items: center;">
|
||||||
<div>
|
<div>
|
||||||
<div style="font-weight: 700; color: ${color};">${t.descripcion || t.tipo}</div>
|
<div style="font-weight: 700; color: ${color};">${t.descripcion || t.tipo}</div>
|
||||||
<div style="font-size: 0.7rem; color: #94a3b8;">${fecha}</div>
|
<div style="font-size: 0.7rem; color: #94a3b8;">${fecha}</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px;">
|
||||||
<div style="font-weight: 800; color: ${isSinpeRechazado ? '#be123c' : (esPositivo ? '#10b981' : '#ef4444')};">
|
<div style="font-weight: 800; color: ${isSinpeRechazado ? '#be123c' : (esPositivo ? '#10b981' : '#ef4444')};">
|
||||||
${isSinpeRechazado ? '₡' + Math.abs(t.monto_colones).toLocaleString('es-CR') + ' (Rechazado)' : signo + '₡' + Math.abs(t.monto_colones).toLocaleString('es-CR')}
|
${isSinpeRechazado ? '₡' + Math.abs(t.monto_colones).toLocaleString('es-CR') + ' (Rechazado)' : signo + '₡' + Math.abs(t.monto_colones).toLocaleString('es-CR')}
|
||||||
</div>
|
</div>
|
||||||
|
${isSinpeRechazado ? `
|
||||||
|
<button type="button" onclick="verMotivoRechazoSinpe({ monto_colones: ${Math.abs(t.monto_colones)}, comprobante_sinpe: '${safeComp}', notas: '${safeDesc}', creado_en: '${t.fecha || ''}' })" style="background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; border-radius: 5px; padding: 2px 7px; font-size: 0.65rem; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 3px;" title="Ver motivo">
|
||||||
|
<span>Ver motivo</span>
|
||||||
|
</button>
|
||||||
|
` : ''}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}).join('');
|
}).join('');
|
||||||
@@ -3968,6 +3978,8 @@ async function loadParentSinpeRequests(studentId) {
|
|||||||
if (!res.ok) throw new Error(data.error);
|
if (!res.ok) throw new Error(data.error);
|
||||||
|
|
||||||
const solicitudes = data.solicitudes || [];
|
const solicitudes = data.solicitudes || [];
|
||||||
|
window._parentSinpeSolicitudes = solicitudes;
|
||||||
|
|
||||||
if (solicitudes.length === 0) {
|
if (solicitudes.length === 0) {
|
||||||
box.style.display = 'none';
|
box.style.display = 'none';
|
||||||
list.innerHTML = '';
|
list.innerHTML = '';
|
||||||
@@ -3975,10 +3987,11 @@ async function loadParentSinpeRequests(studentId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
box.style.display = 'block';
|
box.style.display = 'block';
|
||||||
list.innerHTML = solicitudes.slice(0, 5).map(s => {
|
list.innerHTML = solicitudes.slice(0, 10).map(s => {
|
||||||
const fecha = new Date(s.creado_en).toLocaleString('es-CR', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
|
const fecha = new Date(s.creado_en).toLocaleString('es-CR', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
|
||||||
let badgeStyle = '';
|
let badgeStyle = '';
|
||||||
let badgeText = '';
|
let badgeText = '';
|
||||||
|
const isRechazado = s.estado === 'rechazada' || s.estado === 'rechazado';
|
||||||
|
|
||||||
if (s.estado === 'pendiente') {
|
if (s.estado === 'pendiente') {
|
||||||
badgeStyle = 'background: #fef3c7; color: #b45309; border: 1px solid #fde68a;';
|
badgeStyle = 'background: #fef3c7; color: #b45309; border: 1px solid #fde68a;';
|
||||||
@@ -3994,13 +4007,19 @@ async function loadParentSinpeRequests(studentId) {
|
|||||||
const refLabel = s.codigo_detalle ? `Cód: ${s.codigo_detalle}` : `Comp: #${s.comprobante_sinpe}`;
|
const refLabel = s.codigo_detalle ? `Cód: ${s.codigo_detalle}` : `Comp: #${s.comprobante_sinpe}`;
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<div style="background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; font-size: 0.76rem;">
|
<div style="background: ${isRechazado ? '#fff8f8' : 'white'}; border: 1px solid ${isRechazado ? '#fecaca' : '#e2e8f0'}; border-radius: 8px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; font-size: 0.76rem; transition: all 0.15s ease;">
|
||||||
<div>
|
<div>
|
||||||
<div style="font-weight: 800; color: #0f172a;">₡${s.monto_colones.toLocaleString('es-CR')} <span style="font-weight: 600; color: #166534; font-family: monospace;">(${refLabel})</span></div>
|
<div style="font-weight: 800; color: #0f172a;">₡${s.monto_colones.toLocaleString('es-CR')} <span style="font-weight: 600; color: #166534; font-family: monospace;">(${refLabel})</span></div>
|
||||||
<div style="font-size: 0.68rem; color: #94a3b8;">${fecha}</div>
|
<div style="font-size: 0.68rem; color: #94a3b8;">${fecha}</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div style="display: flex; flex-direction: column; align-items: flex-end; gap: 4px;">
|
||||||
<span style="font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; ${badgeStyle}">${badgeText}</span>
|
<span style="font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px; ${badgeStyle}">${badgeText}</span>
|
||||||
|
${isRechazado ? `
|
||||||
|
<button type="button" onclick="verMotivoRechazoSinpe(${s.id})" style="background: #fff1f2; color: #be123c; border: 1.5px solid #fecdd3; border-radius: 6px; padding: 2px 8px; font-size: 0.68rem; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; box-shadow: 0 1px 2px rgba(190, 18, 60, 0.08); transition: all 0.15s ease;" title="Ver motivo del rechazo">
|
||||||
|
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
|
||||||
|
<span>Ver motivo</span>
|
||||||
|
</button>
|
||||||
|
` : ''}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -385,4 +385,151 @@
|
|||||||
await fn(motivoFinal);
|
await fn(motivoFinal);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ========================================================
|
||||||
|
// LÓGICA DEL MODAL DE DETALLE DE RECHAZO SINPE (PORTAL DE PADRES)
|
||||||
|
// ========================================================
|
||||||
|
function ensureParentMotivoRechazoModalDom() {
|
||||||
|
let modal = document.getElementById('modalParentVerMotivoRechazo');
|
||||||
|
if (!modal) {
|
||||||
|
modal = document.createElement('div');
|
||||||
|
modal.id = 'modalParentVerMotivoRechazo';
|
||||||
|
modal.className = 'modal-qr-backdrop';
|
||||||
|
modal.style.display = 'none';
|
||||||
|
modal.style.zIndex = '99999';
|
||||||
|
modal.setAttribute('onclick', 'cerrarModalParentMotivoRechazo(event)');
|
||||||
|
modal.innerHTML = `
|
||||||
|
<div class="modal-qr-card" onclick="event.stopPropagation()" style="max-width: 440px; text-align: left; padding: 22px; border-radius: 18px; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.2);">
|
||||||
|
<div style="display: flex; align-items: center; justify-content: space-between; border-bottom: 1.5px solid var(--border, #e2e8f0); padding-bottom: 10px; margin-bottom: 14px;">
|
||||||
|
<div style="display: flex; align-items: center; gap: 10px;">
|
||||||
|
<div style="width: 36px; height: 36px; border-radius: 10px; background: #fee2e2; color: #dc2626; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0;">
|
||||||
|
🚫
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3 style="margin: 0; font-size: 1.05rem; font-weight: 900; color: #991b1b;">Recarga No Acreditada</h3>
|
||||||
|
<span style="font-size: 0.72rem; color: var(--text-muted, #64748b);">Detalle del rechazo reportado por la soda</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="button" onclick="cerrarModalParentMotivoRechazo()" style="background: none; border: none; font-size: 1.3rem; color: var(--text-muted, #64748b); cursor: pointer; padding: 4px;" title="Cerrar">✕</button>
|
||||||
|
</div>
|
||||||
|
<div style="background: rgba(148, 163, 184, 0.08); border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 0.80rem; line-height: 1.45;">
|
||||||
|
<div style="display: flex; justify-content: space-between;">
|
||||||
|
<span style="color: var(--text-muted, #64748b);">Estudiante:</span>
|
||||||
|
<strong id="parentMotivoEstudiante" style="color: var(--text-main, #0f172a);">-</strong>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; justify-content: space-between; margin-top: 3px;">
|
||||||
|
<span style="color: var(--text-muted, #64748b);">Monto Solicitado:</span>
|
||||||
|
<strong id="parentMotivoMonto" style="color: #0284c7; font-size: 0.92rem;">₡0</strong>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; justify-content: space-between; margin-top: 3px;">
|
||||||
|
<span style="color: var(--text-muted, #64748b);">Referencia / Cód:</span>
|
||||||
|
<strong id="parentMotivoComprobante" style="color: var(--text-main, #334155); font-family: monospace;">-</strong>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; justify-content: space-between; margin-top: 3px;">
|
||||||
|
<span style="color: var(--text-muted, #64748b);">Fecha de Solicitud:</span>
|
||||||
|
<span id="parentMotivoFecha" style="color: var(--text-muted, #64748b); font-size: 0.76rem;">-</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="background: #fff1f2; border: 1.5px solid #fecdd3; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;">
|
||||||
|
<div style="font-size: 0.72rem; font-weight: 800; color: #be123c; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 5px;">
|
||||||
|
<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>
|
||||||
|
<span>Motivo indicado por la soda:</span>
|
||||||
|
</div>
|
||||||
|
<div id="parentMotivoTexto" style="font-size: 0.88rem; font-weight: 800; color: #991b1b; margin-top: 5px; line-height: 1.45;">
|
||||||
|
Fondos no verificados en la cuenta bancaria de la soda.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="font-size: 0.74rem; color: #64748b; line-height: 1.42; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; margin-bottom: 16px;">
|
||||||
|
<span style="font-size: 1rem; line-height: 1.1;">ℹ️</span>
|
||||||
|
<span>
|
||||||
|
Si realizaste la transferencia correctamente desde tu banco, por favor comunícate con la administración de la soda escolar y presenta el comprobante oficial para su verificación manual.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<button type="button" onclick="cerrarModalParentMotivoRechazo()" class="btn-saas btn-saas-primary" style="width: 100%; height: 38px; font-weight: 800; font-size: 0.88rem; justify-content: center; cursor: pointer;">
|
||||||
|
Entendido
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
document.body.appendChild(modal);
|
||||||
|
}
|
||||||
|
return modal;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.verMotivoRechazoSinpe = function(dataOrId) {
|
||||||
|
let sol = null;
|
||||||
|
if (dataOrId && typeof dataOrId === 'object') {
|
||||||
|
sol = dataOrId;
|
||||||
|
} else if (dataOrId !== undefined && dataOrId !== null) {
|
||||||
|
const list = window._parentSinpeSolicitudes || [];
|
||||||
|
sol = list.find(x => x.id === Number(dataOrId));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sol) {
|
||||||
|
console.warn('Solicitud SINPE no encontrada para mostrar motivo');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ensureParentMotivoRechazoModalDom();
|
||||||
|
|
||||||
|
const estEl = document.getElementById('parentMotivoEstudiante');
|
||||||
|
const montoEl = document.getElementById('parentMotivoMonto');
|
||||||
|
const compEl = document.getElementById('parentMotivoComprobante');
|
||||||
|
const fechaEl = document.getElementById('parentMotivoFecha');
|
||||||
|
const textoEl = document.getElementById('parentMotivoTexto');
|
||||||
|
|
||||||
|
const estNombre = (window.currentParentChild && window.currentParentChild.nombre_completo)
|
||||||
|
|| sol.estudiante_nombre
|
||||||
|
|| (window.currentStudent && window.currentStudent.nombre_completo)
|
||||||
|
|| 'Estudiante';
|
||||||
|
const monto = Number(sol.monto_colones || sol.monto || 0);
|
||||||
|
const ref = sol.codigo_detalle
|
||||||
|
? `Cód: ${sol.codigo_detalle}`
|
||||||
|
: (sol.comprobante_sinpe ? `#${sol.comprobante_sinpe}` : 'N/A');
|
||||||
|
|
||||||
|
let fecha = sol.creado_en || sol.fecha || '';
|
||||||
|
try {
|
||||||
|
if (fecha) {
|
||||||
|
fecha = new Date(fecha).toLocaleString('es-CR', { month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' });
|
||||||
|
}
|
||||||
|
} catch(e) {}
|
||||||
|
|
||||||
|
let motivo = sol.notas || sol.descripcion || '';
|
||||||
|
motivo = motivo.replace(/^SINPE Rechazado:\s*/i, '').replace(/\(Comprobante\s*#?[^)]*\)/i, '').trim();
|
||||||
|
if (!motivo) {
|
||||||
|
motivo = 'Fondos no verificados o no recibidos en la cuenta bancaria de la soda escolar.';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (estEl) estEl.textContent = estNombre;
|
||||||
|
if (montoEl) montoEl.textContent = `₡${monto.toLocaleString('es-CR')}`;
|
||||||
|
if (compEl) compEl.textContent = ref;
|
||||||
|
if (fechaEl) fechaEl.textContent = fecha || 'Reciente';
|
||||||
|
if (textoEl) textoEl.textContent = motivo;
|
||||||
|
|
||||||
|
const modal = document.getElementById('modalParentVerMotivoRechazo');
|
||||||
|
if (modal) {
|
||||||
|
modal.style.display = 'flex';
|
||||||
|
if (window.sounds && typeof window.sounds.playNotice === 'function') {
|
||||||
|
window.sounds.playNotice();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.cerrarModalParentMotivoRechazo = function(event) {
|
||||||
|
if (event && event.target && event.target.closest && event.target.closest('.modal-qr-card') && event.target !== event.currentTarget) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const modal = document.getElementById('modalParentVerMotivoRechazo');
|
||||||
|
if (modal) {
|
||||||
|
modal.style.display = 'none';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener('keydown', (e) => {
|
||||||
|
if (e.key === 'Escape') {
|
||||||
|
const parentModal = document.getElementById('modalParentVerMotivoRechazo');
|
||||||
|
if (parentModal && parentModal.style.display !== 'none') {
|
||||||
|
window.cerrarModalParentMotivoRechazo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
|
|||||||
+4
-4
@@ -5,7 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>SiboPay POS - Terminal de Mostrador y Despacho</title>
|
<title>SiboPay POS - Terminal de Mostrador y Despacho</title>
|
||||||
<link rel="icon" type="image/png" href="/img/sibopay-emblem.png">
|
<link rel="icon" type="image/png" href="/img/sibopay-emblem.png">
|
||||||
<link rel="stylesheet" href="/css/styles.css?v=13.6">
|
<link rel="stylesheet" href="/css/styles.css?v=13.7">
|
||||||
<style>
|
<style>
|
||||||
/* Estilos específicos de terminal de alta velocidad */
|
/* Estilos específicos de terminal de alta velocidad */
|
||||||
.student-badge-scanned {
|
.student-badge-scanned {
|
||||||
@@ -673,10 +673,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/js/dialogs.js?v=13.6"></script>
|
<script src="/js/dialogs.js?v=13.7"></script>
|
||||||
<script src="/js/sounds.js?v=8.6"></script>
|
<script src="/js/sounds.js?v=9.6"></script>
|
||||||
<script src="/js/jsQR.js"></script>
|
<script src="/js/jsQR.js"></script>
|
||||||
<script src="/js/food-icons.js?v=1.1"></script>
|
<script src="/js/food-icons.js?v=1.1"></script>
|
||||||
<script src="/js/pos.js?v=13.6"></script>
|
<script src="/js/pos.js?v=13.7"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
// SiboPay PWA Service Worker v13.6 - Exportación nativa Excel XLSX con acentos limpios
|
// SiboPay PWA Service Worker v13.7 - Modal Ver Motivo de Rechazo SINPE en Portal de Padres
|
||||||
const CACHE_NAME = 'sibopay-v13.6';
|
const CACHE_NAME = 'sibopay-v13.7';
|
||||||
const STATIC_ASSETS = [
|
const STATIC_ASSETS = [
|
||||||
'/',
|
'/',
|
||||||
'/index.html',
|
'/index.html',
|
||||||
|
|||||||
Reference in New Issue
Block a user