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']); }