From 67f6e23ffd1f4043c3ad59106a92e66166d73de6 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Fri, 17 Jul 2026 16:51:29 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20clearCache=20en=20TomSelect=20para=20apl?= =?UTF-8?q?icar=20filtro=20de=20g=C3=A9nero=20correctamente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- modules/turnero/views/recepcion.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/turnero/views/recepcion.php b/modules/turnero/views/recepcion.php index fce0d35..625bfaf 100644 --- a/modules/turnero/views/recepcion.php +++ b/modules/turnero/views/recepcion.php @@ -1630,14 +1630,15 @@ function filtrarExamenesPorGenero() { if (!examTS) return; const genero = (pacienteActivo?.genero || '').toUpperCase(); const bloqueados = []; - Object.values(examTS.options).forEach(opt => { + Object.entries(examTS.options).forEach(([val, opt]) => { const gp = (opt['data-genero'] || '').toUpperCase(); const incompatible = !!(gp && genero && gp !== genero); opt.disabled = incompatible; - if (incompatible && examTS.items.includes(String(opt.value))) bloqueados.push(String(opt.value)); + if (incompatible && examTS.items.includes(String(val))) bloqueados.push(String(val)); }); bloqueados.forEach(id => examTS.removeItem(id, true)); if (bloqueados.length) recalcularPrecios(); + examTS.clearCache(); examTS.refreshOptions(false); }