From fc3d25dd18bfb19e8a6f59a5803affebec67d3b7 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Fri, 25 Oct 2024 21:48:19 -0300 Subject: [PATCH] FIX: Cuotas hoy y pendientes. --- app/src/Repository/Venta/Cuota.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/Repository/Venta/Cuota.php b/app/src/Repository/Venta/Cuota.php index 2578dc5..16b2c69 100644 --- a/app/src/Repository/Venta/Cuota.php +++ b/app/src/Repository/Venta/Cuota.php @@ -83,9 +83,7 @@ class Cuota extends Ideal\Repository ->joined('JOIN venta ON venta.pie = a.pie') ->joined('JOIN (SELECT ev1.* FROM estado_venta ev1 JOIN (SELECT MAX(id) AS id, venta FROM estado_venta GROUP BY venta) ev0 ON ev0.id = ev1.id) ev ON ev.venta = venta.id') ->joined('JOIN tipo_estado_venta tev ON tev.id = ev.estado') - ->where('tep.descripcion = ?') - ->where('pago.fecha = CURDATE()') - ->where('tev.descripcion IN (?, ?, ?)'); + ->where('tep.descripcion = ? AND pago.fecha = CURDATE() AND tev.descripcion IN (?, ?, ?)'); return $this->fetchMany($query, ['no pagado', 'vigente', 'escriturando', 'firmado por inmobiliaria']); } public function fetchPendientes(): array @@ -108,9 +106,7 @@ class Cuota extends Ideal\Repository ->joined('JOIN proyecto_tipo_unidad ptu ON ptu.id = unidad.pt') ->joined('JOIN proyecto ON proyecto.id = ptu.proyecto') ->joined('JOIN banco ON banco.id = pago.banco') - ->where('tep.descripcion = ?') - ->where('pago.fecha < CURDATE()') - ->where('tev.descripcion IN (?, ?, ?)') + ->where('tep.descripcion = ? AND pago.fecha < CURDATE() AND tev.descripcion IN (?, ?, ?)') ->order('pago.fecha DESC'); return $this->fetchAsArray($query, ['no pagado', 'vigente', 'escriturando', 'firmado por inmobiliaria']); }