mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for generating PDFs
This commit is contained in:
parent
9d9b59ffc5
commit
0c54b20987
@ -821,7 +821,14 @@ class InvoiceController extends BaseController
|
||||
$contact = $invitation->contact;
|
||||
$invoice = $invitation->invoice;
|
||||
|
||||
$file = $invoice->service()->getInvoicePdf($contact);
|
||||
// $file = $invoice->service()->getInvoicePdf($contact);
|
||||
|
||||
/************** */
|
||||
$file_name = $invoice->numberFormatter().'.pdf';
|
||||
|
||||
$file = (new \App\Jobs\Entity\CreateRawPdf($invitation, $invitation->company->db))->handle();
|
||||
|
||||
/************* */
|
||||
|
||||
$headers = ['Content-Type' => 'application/pdf'];
|
||||
|
||||
@ -830,8 +837,8 @@ class InvoiceController extends BaseController
|
||||
}
|
||||
|
||||
return response()->streamDownload(function () use ($file) {
|
||||
echo Storage::get($file);
|
||||
}, basename($file), $headers);
|
||||
echo $file;
|
||||
}, $file_name, $headers);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -20,6 +20,8 @@ class GetInvoicePdf extends AbstractService
|
||||
{
|
||||
public $entity;
|
||||
|
||||
public $contact;
|
||||
|
||||
public function __construct($entity, ClientContact $contact = null)
|
||||
{
|
||||
$this->entity = $entity;
|
||||
|
Loading…
x
Reference in New Issue
Block a user