feat(admin): permitir al administrador configurar numero y titular SINPE en caliente v20.4

This commit is contained in:
unknown
2026-10-09 12:32:22 -06:00
parent 2c7e468d22
commit 2057a610fb
5 changed files with 330 additions and 13 deletions
+72 -7
View File
@@ -12,7 +12,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="SiboPay">
<link rel="preload" href="/css/styles.css?v=19.9" as="style">
<link rel="preload" href="/js/app.js?v=20.3" as="script">
<link rel="preload" href="/js/app.js?v=20.4" as="script">
<link rel="stylesheet" href="/css/styles.css?v=19.9">
<link rel="stylesheet" href="/css/desktop.css?v=2.2">
<style>
@@ -1340,9 +1340,9 @@
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M16 22h2a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v3"/><path d="m3 12.5 3 3 6-6"/></svg>
<span>Movimientos & Reversiones</span>
</button>
<button class="admin-tab-btn" id="btnTabAdminHorarios" onclick="switchAdminTab('horarios')" title="Horarios de Recreos y Almuerzos">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
<span>Horarios & Recreos</span>
<button class="admin-tab-btn" id="btnTabAdminHorarios" onclick="switchAdminTab('horarios')" title="Configuración de la Soda, Cuenta SINPE y Horarios">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>
<span>Configuración & SINPE</span>
</button>
</div>
@@ -1785,8 +1785,73 @@
</div>
</div>
<!-- TAB 6: HORARIOS ESCOLARES (RECREOS Y ALMUERZO) -->
<div id="adminTabContentHorarios" class="admin-card" style="display: none; max-width: 780px; margin: 0 auto;">
<!-- TAB 6: CONFIGURACIÓN GENERAL DE LA SODA & HORARIOS -->
<div id="adminTabContentHorarios" class="admin-card" style="display: none; max-width: 820px; margin: 0 auto;">
<!-- SECCIÓN 1: CUENTA RECEPTORA DE SINPE MÓVIL DE LA SODA -->
<div style="background: var(--bg-main); border: 1.5px solid var(--border); border-radius: 14px; padding: 22px; margin-bottom: 22px; box-shadow: 0 1px 3px rgba(0,0,0,0.03);">
<div style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; gap: 10px;">
<div>
<div style="display: flex; align-items: center; gap: 8px;">
<span style="font-size: 1.35rem;">📲</span>
<h3 style="margin: 0; font-size: 1.18rem; font-weight: 900; color: var(--text-main);">
Cuenta Receptora de SINPE Móvil
</h3>
</div>
<p style="margin: 4px 0 0 0; font-size: 0.80rem; color: var(--text-muted); max-width: 650px;">
Configura el número telefónico y el titular a donde llegarán las transferencias de recarga. Los padres de familia verán esta información de inmediato en su app al solicitar una recarga por SINPE Móvil.
</p>
</div>
<span style="background: #e0f2fe; color: #0284c7; font-size: 0.74rem; font-weight: 800; padding: 4px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 5px;">
<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>
En Caliente
</span>
</div>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 14px;">
<!-- Teléfono SINPE -->
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 14px;">
<label for="inputAdminTelefonoSinpe" style="display: flex; align-items: center; gap: 6px; font-size: 0.80rem; font-weight: 800; color: var(--text-main); margin-bottom: 6px;">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#0284c7" stroke-width="2"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
Número Celular SINPE Móvil:
</label>
<input type="tel" id="inputAdminTelefonoSinpe" placeholder="Ej: 8888-8888" oninput="actualizarPreviewAdminSinpe()" style="width: 100%; padding: 10px 14px; border-radius: 9px; border: 1.5px solid var(--border); font-size: 1.05rem; font-weight: 800; color: #0284c7; background: var(--bg-main); outline: none; box-sizing: border-box; letter-spacing: 0.5px;">
<span style="display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 4px;">Ingresa 8 dígitos (ej: 8888-8888 o 88888888)</span>
</div>
<!-- Titular SINPE -->
<div style="background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 14px;">
<label for="inputAdminTitularSinpe" style="display: flex; align-items: center; gap: 6px; font-size: 0.80rem; font-weight: 800; color: var(--text-main); margin-bottom: 6px;">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#10b981" stroke-width="2"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
Nombre del Titular de la Cuenta:
</label>
<input type="text" id="inputAdminTitularSinpe" placeholder="Ej: Soda Escolar Central S.A." oninput="actualizarPreviewAdminSinpe()" style="width: 100%; padding: 10px 14px; border-radius: 9px; border: 1.5px solid var(--border); font-size: 0.95rem; font-weight: 800; color: var(--text-main); background: var(--bg-main); outline: none; box-sizing: border-box;">
<span style="display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 4px;">Nombre físico o comercial asociado al número bancario</span>
</div>
</div>
<!-- Vista previa de cómo lo verán los padres -->
<div style="background: var(--card-bg); border: 1.5px dashed var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;">
<div style="display: flex; align-items: center; gap: 10px;">
<span style="font-size: 1.15rem;">👀</span>
<div style="font-size: 0.80rem; color: var(--text-main); font-weight: 700;">
Vista previa para los padres:
<span style="color: #0284c7; font-weight: 900;" id="previewAdminSinpeTel">8888-8888</span> — Titular:
<span style="color: #10b981; font-weight: 900;" id="previewAdminSinpeTitular">Soda Escolar</span>
</div>
</div>
<span style="font-size: 0.72rem; color: var(--text-muted); font-weight: 600;">Se actualizará en tiempo real</span>
</div>
<div style="display: flex; justify-content: flex-end; gap: 10px;">
<button type="button" id="btnGuardarAdminSinpe" onclick="guardarAdminSinpeConfig()" class="btn-saas btn-saas-primary" style="padding: 10px 22px; font-size: 0.88rem; font-weight: 800; display: inline-flex; align-items: center; gap: 7px; box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg>
<span id="lblBtnGuardarAdminSinpe">Guardar Datos SINPE Móvil</span>
</button>
</div>
</div>
<!-- SECCIÓN 2: HORARIOS DE RECREOS Y ALMUERZO -->
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px;">
<div>
<h3 style="margin: 0; font-size: 1.15rem; font-weight: 900; color: var(--text-main);">
@@ -5172,6 +5237,6 @@
<script src="/js/sounds.js?v=19.4"></script>
<script src="/js/jsQR.js" defer></script>
<script src="/js/food-icons.js?v=19.4" defer></script>
<script src="/js/app.js?v=20.3"></script>
<script src="/js/app.js?v=20.4"></script>
</body>
</html>