Change to xlsx file
This commit is contained in:
@ -4,6 +4,8 @@ namespace App\Service\Informe\Contabilidad;
|
||||
use DateTimeInterface;
|
||||
use DateTimeImmutable;
|
||||
use DateInterval;
|
||||
|
||||
use App\Service\Informe\Informe;
|
||||
use Incoviba\old\Proyecto\Proyecto;
|
||||
use Incoviba\old\Venta\Venta;
|
||||
use Incoviba\old\Venta\Pago;
|
||||
@ -137,7 +139,7 @@ class Resumen
|
||||
$haber -= $pago->valor;
|
||||
}
|
||||
}
|
||||
$output []= implode($this->separator, ['', $haber, $debe]);
|
||||
$output []= implode($this->separator, ['', '', $haber, $debe]);
|
||||
return $output;
|
||||
}
|
||||
|
||||
@ -150,7 +152,12 @@ class Resumen
|
||||
$output = array_merge($output, $this->buildLibro($venta, $up_to), [''], ['']);
|
||||
}
|
||||
|
||||
$filename = "Contabilidad - Resumen - {$ventas[0]->proyecto()->descripcion} - {$up_to->format('Y-m-d')}.csv";
|
||||
$filename = "Contabilidad - Resumen - {$ventas[0]->proyecto()->descripcion} - {$up_to->format('Y-m-d')}.xlsx";
|
||||
$informe = new Informe();
|
||||
$informe->createSpreadsheet()
|
||||
->addArray($output)
|
||||
->send($filename);
|
||||
return;
|
||||
|
||||
header("Content-Type: text/csv; charset=utf-8");
|
||||
header('Content-Disposition: attachment; filename="' . $filename . '"');
|
||||
|
Reference in New Issue
Block a user