diff --git a/modules/turnero/views/recepcion.php b/modules/turnero/views/recepcion.php index cf6ca6b..65c3894 100644 --- a/modules/turnero/views/recepcion.php +++ b/modules/turnero/views/recepcion.php @@ -496,16 +496,21 @@ async function cargarCola() { function renderCola(snap) { const lista = document.getElementById('cola-items'); const todos = snap.cola || []; - const espera = todos.filter(t => t.estado === 'espera'); const badge = document.getElementById('badge-count'); - badge.textContent = espera.length; - if (espera.length === 0) { + // Filtrar: 'espera' todos; 'en_recepcion' solo los de este escritorio + const visibles = todos.filter(t => + t.estado === 'espera' || + (t.estado === 'en_recepcion' && (t.recepcion_desk_id === null || t.recepcion_desk_id == DESK_ID)) + ); + badge.textContent = visibles.length; + + if (visibles.length === 0) { lista.innerHTML = `