diff --git a/public/index.html b/public/index.html
index 271c23a..5a67d46 100644
--- a/public/index.html
+++ b/public/index.html
@@ -256,6 +256,10 @@
Escuelas & Sedes
+
+
+ Carga Masiva (Excel/CSV)
+
@@ -438,6 +442,46 @@
+
+
+
+
+ 👥 Carga Masiva de Estudiantes vía Excel / CSV
+
+
+ Importa decenas o cientos de estudiantes en segundos. Puedes subir un archivo .csv o pegar las celdas directamente copiadas desde Microsoft Excel o Google Sheets.
+
+
+
+ 📥 Descargar Plantilla Ejemplo (.CSV)
+
+
+
+
+
+
+ 1. Selecciona la Escuela / Sede de Destino: *
+
+
+
+
+
+
+
+
+
+
+ 2. Pega aquí los datos desde Excel o escribe en formato CSV:
+
+ Columnas: Nombre, Grado, Sección, Saldo (opcional), Alergias (opcional), Tel. Padre (opcional)
+
+
+
+
+
+ O selecciona archivo CSV:
+
+
+
+ 🔍 Previsualizar y Validar
+
+
+
+
+
+
+
+
+ 0 Alumnos Detectados
+ Revisa la lista antes de guardar
+
+
+ ⚡ Confirmar e Importar Todos los Estudiantes
+
+
+
+
+
+
+
+ #
+ Nombre Completo
+ Grado/Sección
+ Saldo Inicial
+ Alergias
+ Teléfono Padre
+ Código Asignado
+
+
+
+
+
+
+
+
+
+
+
+
@@ -507,6 +635,14 @@
+ ${idx + 1}
+ ${escapeHtml(st.nombre_completo)}
+ ${escapeHtml(st.grado)} - ${escapeHtml(st.seccion)}
+ ₡${st.saldo_inicial.toLocaleString('es-CR')}
+ ${escapeHtml(st.alergias)}
+ ${escapeHtml(st.padre_telefono || '-')}
+ (Auto-generado)
+
+ `).join('');
+ }
+
+ if (previewBox) previewBox.style.display = 'block';
+}
+
+async function ejecutarImportacionMasivaDev() {
+ if (!parsedStudentsToImport || parsedStudentsToImport.length === 0) {
+ alert('Primero analiza y previsualiza los estudiantes a importar.');
+ return;
+ }
+
+ const select = document.getElementById('devImportEscuelaSelect');
+ const escuelaId = select ? parseInt(select.value, 10) : 1;
+ const btn = document.getElementById('btnDevEjecutarImport');
+ const resultMsg = document.getElementById('devImportResultMsg');
+
+ if (btn) {
+ btn.disabled = true;
+ btn.textContent = '⏳ Importando en la Base de Datos...';
+ }
+
+ try {
+ const res = await fetch('/api/developer/estudiantes/importar-masivo', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({
+ escuela_id: escuelaId,
+ estudiantes: parsedStudentsToImport
+ })
+ });
+
+ const data = await res.json();
+ if (!res.ok) throw new Error(data.error || 'Error al procesar la importación.');
+
+ if (window.sounds) {
+ window.sounds.playSuccess();
+ window.sounds.playCoin();
+ }
+
+ if (resultMsg) {
+ resultMsg.style.display = 'block';
+ resultMsg.style.background = '#f0fdf4';
+ resultMsg.style.border = '1.5px solid #86efac';
+ resultMsg.style.color = '#166534';
+ resultMsg.innerHTML = `
+ Total procesados: ${data.totalProcesados} · Insertados con éxito: ${data.insertados} · Omitidos: ${data.omitidos}
+ ${data.errores && data.errores.length > 0 ? `
+
SIBOPAY
+
SODA ESCOLAR • COMPROBANTE
+
+
+
+
Fecha: ${fechaFmt}
+
Ticket: #${escapeHtml(ord.orderCode)}
+
Estudiante: ${escapeHtml(ord.student?.nombre_completo || 'Cliente')}
+ ${ord.student?.grado ? `
Grado: ${escapeHtml(ord.student.grado)}
` : ''}
+
+
+
+
+
+
+
+ Cant.
+ Detalle
+ Total
+
+
+
+ ${itemsRows}
+
+
+
+
+
+
+ TOTAL COBRADO:
+ ₡${Number(ord.total || 0).toLocaleString('es-CR')}
+
+
+
+ Saldo Disponible:
+ ₡${Number(ord.nuevoSaldo || 0).toLocaleString('es-CR')}
+
+
+
+
+ ¡Gracias por su compra!
+ Monedero Escolar SiboPay
+
+
+ `;
+
+ window.print();
+}
+window.imprimirTicketTermico = imprimirTicketTermico;
+
+
diff --git a/public/pos.html b/public/pos.html
index aee4559..e2a84c3 100644
--- a/public/pos.html
+++ b/public/pos.html
@@ -38,6 +38,36 @@
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
+
+ /* Formateo de impresión para Comanda / Ticket Térmico (58mm / 80mm) */
+ @media print {
+ body * {
+ visibility: hidden !important;
+ }
+ #posThermalReceipt, #posThermalReceipt * {
+ visibility: visible !important;
+ }
+ #posThermalReceipt {
+ position: fixed !important;
+ left: 0 !important;
+ top: 0 !important;
+ width: 100% !important;
+ max-width: 80mm !important;
+ margin: 0 !important;
+ padding: 4mm 2mm !important;
+ font-family: 'Courier New', Courier, monospace !important;
+ font-size: 12px !important;
+ line-height: 1.3 !important;
+ color: #000000 !important;
+ background: #ffffff !important;
+ display: block !important;
+ z-index: 999999 !important;
+ }
+ @page {
+ margin: 0;
+ size: auto;
+ }
+ }
-
+