mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Refactors for generation of PDFs
This commit is contained in:
parent
327c782ba5
commit
ec562f645a
@ -565,10 +565,11 @@ class RecurringInvoiceController extends BaseController
|
||||
return response()->json(['message' => 'no record found'], 400);
|
||||
}
|
||||
|
||||
$contact = $invitation->contact;
|
||||
$invoice = $invitation->recurring_invoice;
|
||||
|
||||
$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'];
|
||||
|
||||
@ -577,8 +578,9 @@ class RecurringInvoiceController extends BaseController
|
||||
}
|
||||
|
||||
return response()->streamDownload(function () use ($file) {
|
||||
echo Storage::get($file);
|
||||
}, basename($file), $headers);
|
||||
echo $file;
|
||||
}, $file_name, $headers);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user