From c18da173175c33760656b6011d941d6fb72fe3d8 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Sat, 11 Jul 2026 09:18:58 -0500 Subject: [PATCH] Fix pre-servicios preview: clear store once, clean row HTML structure - Move _rdaJsonStore={} reset to before both sections so ps-json-* keys are not wiped when pacientes section renders - Replace divide-y wrapper divs with explicit border-b on each row, eliminating duplicate/misplaced dividers in the pre-servicios list Co-Authored-By: Claude Sonnet 4.6 --- app/templates/automation.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/templates/automation.html b/app/templates/automation.html index 00c3283..6eef50e 100644 --- a/app/templates/automation.html +++ b/app/templates/automation.html @@ -209,6 +209,7 @@ async function previewAutomation() { if (!data.success) { showToast(data.message || 'Error al consultar', 'error'); return; } _previewData = data; + _rdaJsonStore = {}; document.getElementById('cnt-pacientes').textContent = data.pacientes; document.getElementById('cnt-recepciones').textContent = data.recepciones; document.getElementById('cnt-examenes').textContent = data.examenes; @@ -222,8 +223,8 @@ async function previewAutomation() { const key = `ps-json-${i}`; _rdaJsonStore[key] = ps.json; return ` -
-
+
${ps.factura} @@ -231,7 +232,7 @@ async function previewAutomation() { Pac. ${ps.paciente} ${ps.examenes} examen(es)
- +
`; }).join(''); psSection.classList.remove('hidden'); @@ -244,7 +245,6 @@ async function previewAutomation() { table.innerHTML = '
No hay pacientes para esta fecha
'; showToast('No hay datos para esa fecha', 'warning'); } else { - _rdaJsonStore = {}; table.innerHTML = data.pacientes_preview.map((p, i) => { const rdaRows = p.rda.map((r, j) => { const key = `rda-json-${i}-${j}`;