From 7f7e230b2a31198926aceac5fa0946aed5eec328 Mon Sep 17 00:00:00 2001 From: marsalva Date: Sun, 1 Mar 2026 14:46:12 +0000 Subject: [PATCH] Actualizar server.js --- server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 6c3f991..1cd1143 100644 --- a/server.js +++ b/server.js @@ -2073,8 +2073,9 @@ app.put("/financials/:id", authMiddleware, async (req, res) => { const { amount, payment_method } = req.body; const parsedAmount = parseFloat(amount) || 0; - // Si el importe es mayor que 0, se marca como pagado automáticamente - const isPaid = parsedAmount > 0; + // NUEVA REGLA: Si el método de pago es "Pendiente", NO está pagado, + // independientemente del importe que tenga apuntado (Ej: Presupuestos). + const isPaid = payment_method !== 'Pendiente'; await pool.query(` UPDATE service_financials