From 30277e63553d6b3cf0de9e3dabdc90c516dcb22b Mon Sep 17 00:00:00 2001 From: Aldarien Date: Wed, 20 Dec 2023 15:37:47 -0300 Subject: [PATCH] FIX: cuotas en pie --- app/src/Repository/Venta/Cuota.php | 8 ++++++++ app/src/Service/Venta/Cuota.php | 4 ++++ app/src/Service/Venta/Pie.php | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/Repository/Venta/Cuota.php b/app/src/Repository/Venta/Cuota.php index 9e3de82..f6c0249 100644 --- a/app/src/Repository/Venta/Cuota.php +++ b/app/src/Repository/Venta/Cuota.php @@ -177,6 +177,14 @@ GROUP BY p1.`fecha`, v1.`descripcion` ORDER BY p1.`fecha`, v1.`descripcion`"; return $this->fetchAsArray($query); } + public function fetchByPie(int $pie_id): array + { + $query = $this->connection->getQueryBuilder() + ->select() + ->from($this->getTable()) + ->where('pie = ?'); + return $this->fetchMany($query, [$pie_id]); + } public function fetchVigenteByPie(int $pie_id): array { $query = "SELECT a.* diff --git a/app/src/Service/Venta/Cuota.php b/app/src/Service/Venta/Cuota.php index c3cda89..4855e77 100644 --- a/app/src/Service/Venta/Cuota.php +++ b/app/src/Service/Venta/Cuota.php @@ -73,6 +73,10 @@ class Cuota } return $cuotas_depositadas; } + public function getByPie(int $pie_id): array + { + return $this->cuotaRepository->fetchByPie($pie_id); + } public function getVigenteByPie(int $pie_id): array { return $this->cuotaRepository->fetchVigenteByPie($pie_id); diff --git a/app/src/Service/Venta/Pie.php b/app/src/Service/Venta/Pie.php index 8085cee..ea84377 100644 --- a/app/src/Service/Venta/Pie.php +++ b/app/src/Service/Venta/Pie.php @@ -39,7 +39,7 @@ class Pie protected function process(Model\Venta\Pie $pie): Model\Venta\Pie { - $pie->cuotasArray = $this->cuotaService->getVigenteByPie($pie->id); + $pie->cuotasArray = $this->cuotaService->getByPie($pie->id); try { $pie->asociados = $this->pieRepository->fetchAsociados($pie->id); } catch (EmptyResult) {}