From 16fb8f0a96b75941c11577ab287c85e957602cd4 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Mon, 7 Mar 2022 22:43:34 -0300 Subject: [PATCH] Filter duplicates --- app/Service/Informe/Contabilidad/Resumen.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Service/Informe/Contabilidad/Resumen.php b/app/Service/Informe/Contabilidad/Resumen.php index 3503e1f..4a80b78 100644 --- a/app/Service/Informe/Contabilidad/Resumen.php +++ b/app/Service/Informe/Contabilidad/Resumen.php @@ -32,7 +32,7 @@ class Resumen protected function getVentas($id_proyecto) { $proyecto = model(Proyecto::class)->findOne($id_proyecto); - return $proyecto->ventas(); + return array_unique($proyecto->ventas()); } protected function startOfYear(DateTimeInterface $up_to) { @@ -122,7 +122,7 @@ class Resumen protected function buildLibro(Venta $venta, DateTimeInterface $up_to) { $pagos = $this->getPagos($venta, $up_to); - $output = ['', "Cuenta: Anticipos Dpto {$venta->unidad()->descripcion}"]; + $output = [' ', "Cuenta: Anticipos Dpto {$venta->unidad()->descripcion}"]; $debe = 0; $haber = 0; foreach ($pagos as $pago) {