FIX: format

This commit is contained in:
Juan Pablo Vial
2022-03-07 22:25:03 -03:00
parent 3b473bcefa
commit 26bac169de
2 changed files with 5 additions and 5 deletions

View File

@ -126,20 +126,20 @@ 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 []= ['', $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 []= ['', $pago->fecha->format('d/m/Y'), $this->formatValue(-$pago->valor), ''];
$haber -= $pago->valor;
}
}
$output []= implode($this->separator, ['', '', $haber, $debe]);
$output []= ['', '', $haber, $debe];
return $output;
}

View File

@ -20,7 +20,7 @@ class Informe
public function send(string $filename)
{
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header("Content-Disposition: attachment;filename='{$filename}'");
header("Content-Disposition: attachment;filename=\"{$filename}\"");
header('Cache-Control: max-age=0');
$writer = IOFactory::createWriter($this->spreadsheet, 'Xlsx');