From a4ddc63b6f7c198c46460a009697c86cef3f3c84 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Thu, 30 Jul 2026 17:55:10 -0500 Subject: [PATCH] fix(encuesta): ocultar barra si paciente no tiene celular registrado MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Si turnoActivo.paciente_cel está vacío, _ofrecerEncuesta retorna sin mostrar la barra, evitando el error de WA al intentar enviar. Co-Authored-By: Claude Sonnet 4.6 --- modules/turnero/views/lugar.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/turnero/views/lugar.php b/modules/turnero/views/lugar.php index fab9e9a..99b9589 100644 --- a/modules/turnero/views/lugar.php +++ b/modules/turnero/views/lugar.php @@ -1989,7 +1989,7 @@ async function finalizarAtencion() { if (hayPendientes) { mostrarError('Debe firmar todos los consentimientos antes de finalizar.'); return; } if (hayMuestrasPendientes) { mostrarError('Debe marcar cada muestra como recibida o pendiente antes de finalizar.'); return; } if (!confirm(`¿Finalizar atención del turno ${turnoActivo.codigo}?`)) return; - const _t = { id: turnoActivo.id, paciente_nombre: turnoActivo.paciente_nombre }; + const _t = { id: turnoActivo.id, paciente_nombre: turnoActivo.paciente_nombre, paciente_cel: turnoActivo.paciente_cel }; const ok = await cambiarEstadoTurno('finalizado'); if (ok) _ofrecerEncuesta(_t); } @@ -2069,6 +2069,7 @@ async function cambiarEstadoTurno(nuevoEstado) { let _encuestaTurnoId = null, _encuestaTimer = null; function _ofrecerEncuesta(turno) { + if (!turno.paciente_cel) return; _encuestaTurnoId = turno.id; const bar = document.getElementById('bar-encuesta'); document.getElementById('bar-encuesta-txt').textContent =