mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -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;
|
$contact = $invitation->contact;
|
||||||
$invoice = $invitation->invoice;
|
$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'];
|
$headers = ['Content-Type' => 'application/pdf'];
|
||||||
|
|
||||||
@ -830,8 +837,8 @@ class InvoiceController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
return response()->streamDownload(function () use ($file) {
|
return response()->streamDownload(function () use ($file) {
|
||||||
echo Storage::get($file);
|
echo $file;
|
||||||
}, basename($file), $headers);
|
}, $file_name, $headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,6 +20,8 @@ class GetInvoicePdf extends AbstractService
|
|||||||
{
|
{
|
||||||
public $entity;
|
public $entity;
|
||||||
|
|
||||||
|
public $contact;
|
||||||
|
|
||||||
public function __construct($entity, ClientContact $contact = null)
|
public function __construct($entity, ClientContact $contact = null)
|
||||||
{
|
{
|
||||||
$this->entity = $entity;
|
$this->entity = $entity;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user