Merge pull request #1722 from pavel-mironchik/document-pdf

Fix downloading a bill's PDF file
This commit is contained in:
Cüneyt Şentürk 2021-01-03 18:06:52 +03:00 committed by GitHub
commit 8f83e239e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -392,7 +392,7 @@ abstract class DocumentShow extends Component
$this->routeButtonEdit = $this->getRouteButtonEdit($type, $routeButtonEdit); $this->routeButtonEdit = $this->getRouteButtonEdit($type, $routeButtonEdit);
$this->routeButtonDuplicate = $this->getRouteButtonDuplicate($type, $routeButtonDuplicate); $this->routeButtonDuplicate = $this->getRouteButtonDuplicate($type, $routeButtonDuplicate);
$this->routeButtonPrint = $this->getRouteButtonPrint($type, $routeButtonPrint); $this->routeButtonPrint = $this->getRouteButtonPrint($type, $routeButtonPrint);
$this->routeButtonPdf = $this->getRouteButtonPrint($type, $routeButtonPdf); $this->routeButtonPdf = $this->getRouteButtonPdf($type, $routeButtonPdf);
$this->routeButtonCancelled = $this->getRouteButtonCancelled($type, $routeButtonCancelled); $this->routeButtonCancelled = $this->getRouteButtonCancelled($type, $routeButtonCancelled);
$this->routeButtonCustomize = $this->getRouteButtonCustomize($type, $routeButtonCustomize); $this->routeButtonCustomize = $this->getRouteButtonCustomize($type, $routeButtonCustomize);
$this->routeButtonDelete = $this->getRouteButtonDelete($type, $routeButtonDelete); $this->routeButtonDelete = $this->getRouteButtonDelete($type, $routeButtonDelete);

View File

@ -293,7 +293,7 @@ class Bills extends Controller
$pdf = app('dompdf.wrapper'); $pdf = app('dompdf.wrapper');
$pdf->loadHTML($html); $pdf->loadHTML($html);
$file_name = $this->getBillFileName($bill); $file_name = $this->getDocumentFileName($bill);
return $pdf->download($file_name); return $pdf->download($file_name);
} }