diff --git a/app/Service/Informe/Contabilidad/Resumen.php b/app/Service/Informe/Contabilidad/Resumen.php index 12b8bc1..f004b85 100644 --- a/app/Service/Informe/Contabilidad/Resumen.php +++ b/app/Service/Informe/Contabilidad/Resumen.php @@ -124,16 +124,16 @@ 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) { if ($pago->valor > 0) { - $output []= implode($this->separator, [$pago->fecha->format('d/m/Y'), '', $this->formatValue($pago->valor)]); + $output []= implode($this->separator, ['', $pago->fecha->format('d/m/Y'), '', $this->formatValue($pago->valor)]); $debe += $pago->valor; } else { - $output []= implode($this->separator, [$pago->fecha->format('d/m/Y'), $this->formatValue(-$pago->valor), '']); + $output []= implode($this->separator, ['', $pago->fecha->format('d/m/Y'), $this->formatValue(-$pago->valor), '']); $haber -= $pago->valor; } } @@ -145,12 +145,12 @@ class Resumen { $ventas = $this->getVentas($id_proyecto); - $output = []; + $output = ["Libro Mayor {$ventas[0]->proyecto()->descripcion}", '']; foreach ($ventas as $venta) { - $output = array_merge($output, $this->buildLibro($venta, $up_to), []); + $output = array_merge($output, $this->buildLibro($venta, $up_to), [''], ['']); } - $filename = "Contabilidad - Resumen - {$venta->proyecto()->descripcion} - {$up_to->format('Y-m-d')}.csv"; + $filename = "Contabilidad - Resumen - {$ventas[0]->proyecto()->descripcion} - {$up_to->format('Y-m-d')}.csv"; header("Content-Type: text/csv; charset=utf-8"); header('Content-Disposition: attachment; filename="' . $filename . '"');