From da1b32e1a3829142f611acfcab4ad2f4a3875ee0 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 21 Apr 2026 13:13:49 -0500 Subject: [PATCH] Update recepcion.php --- modules/turnero/views/recepcion.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/turnero/views/recepcion.php b/modules/turnero/views/recepcion.php index 500256d..bcd3f45 100644 --- a/modules/turnero/views/recepcion.php +++ b/modules/turnero/views/recepcion.php @@ -378,13 +378,14 @@ async function cargarCola() { const res = await fetch(API + 'get_cola.php?area=recepcion'); const json = await res.json(); if (!json.ok) return; - renderCola(json.data); + renderCola(json); } catch (_) {} } function renderCola(snap) { const lista = document.getElementById('cola-items'); - const espera = (snap.cola || []).filter(t => t.estado === 'espera'); + const todos = snap.cola || []; + const espera = todos.filter(t => t.estado === 'espera' || t.estado === 'en_recepcion'); const badge = document.getElementById('badge-count'); badge.textContent = espera.length; @@ -417,11 +418,12 @@ async function llamarSiguiente() { const json = await res.json(); if (!json.ok) { mostrarError(json.error); return; } - if (!json.data.turno) { + const turnoLlamado = json.turno ?? json.data?.turno; + if (!turnoLlamado) { mostrarAviso('Cola vacĂ­a', 'No hay turnos en espera.'); return; } - abrirFicha(json.data.turno); + abrirFicha(turnoLlamado); cargarCola(); } catch (err) { mostrarError(err.message);