From 948ea5c4ddcf8264ca1738a7f3ecfca1889369b9 Mon Sep 17 00:00:00 2001 From: marsalva Date: Sun, 1 Mar 2026 14:47:27 +0000 Subject: [PATCH] Actualizar contabilidad.html --- contabilidad.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contabilidad.html b/contabilidad.html index 897087f..567f162 100644 --- a/contabilidad.html +++ b/contabilidad.html @@ -313,15 +313,16 @@ if (data.ok) { showToast("Cobro actualizado"); - // Actualizar el array local para que los KPIs se recalculen sin recargar de BD + // Actualizar el array local usando la nueva regla de negocio const fIndex = allFinancials.findIndex(f => f.scraped_id === scrapedId); if (fIndex > -1) { allFinancials[fIndex].amount = parseFloat(amount || 0); allFinancials[fIndex].payment_method = method; - allFinancials[fIndex].is_paid = data.is_paid; + // Si nos manda el backend que está pagado o si no es pendiente, es TRUE + allFinancials[fIndex].is_paid = method !== 'Pendiente'; } - // Refrescar lista visualmente + // Refrescar lista y KPIs visualmente renderList(); } else { showToast("Error al guardar.");