From e51d87f83fd28387798582cceb125c6a1c764def Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Mon, 7 Mar 2022 22:45:56 -0300 Subject: [PATCH] FIX: filter --- app/Service/Informe/Contabilidad/Resumen.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Service/Informe/Contabilidad/Resumen.php b/app/Service/Informe/Contabilidad/Resumen.php index 4a80b78..729bdc5 100644 --- a/app/Service/Informe/Contabilidad/Resumen.php +++ b/app/Service/Informe/Contabilidad/Resumen.php @@ -32,7 +32,14 @@ class Resumen protected function getVentas($id_proyecto) { $proyecto = model(Proyecto::class)->findOne($id_proyecto); - return array_unique($proyecto->ventas()); + $ventas = $proyecto->ventas(); + $output = []; + foreach ($ventas as $venta) { + if (!in_array($venta, $output)) { + $output []= $venta; + } + } + return $output; } protected function startOfYear(DateTimeInterface $up_to) {