mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
fixes
This commit is contained in:
parent
e725c9a444
commit
ce4f808945
@ -527,10 +527,11 @@ class InvoiceController extends BaseController
|
||||
|
||||
if ($action == 'download' && $invoices->count() >=1 && $user->can('view', $invoices->first())) {
|
||||
$file = $invoices->first()->service()->getInvoicePdf();
|
||||
|
||||
$filename = $invoices->first()->getFileName();
|
||||
nlog($filename);
|
||||
return response()->streamDownload(function () use ($file) {
|
||||
echo Storage::get($file);
|
||||
}, basename($file), ['Content-Type' => 'application/pdf']);
|
||||
}, $filename, ['Content-Type' => 'application/pdf']);
|
||||
}
|
||||
|
||||
if ($action == 'bulk_print' && $user->can('view', $invoices->first())) {
|
||||
@ -701,10 +702,11 @@ class InvoiceController extends BaseController
|
||||
case 'download':
|
||||
|
||||
$file = $invoice->service()->getInvoicePdf();
|
||||
$filename = $invoice->getFileName();
|
||||
|
||||
return response()->streamDownload(function () use ($file) {
|
||||
echo Storage::get($file);
|
||||
}, basename($file), ['Content-Type' => 'application/pdf']);
|
||||
echo $file;
|
||||
}, $filename, ['Content-Type' => 'application/pdf']);
|
||||
|
||||
case 'restore':
|
||||
$this->invoice_repo->restore($invoice);
|
||||
@ -937,14 +939,11 @@ class InvoiceController extends BaseController
|
||||
public function deliveryNote(ShowInvoiceRequest $request, Invoice $invoice)
|
||||
{
|
||||
$file = $invoice->service()->getInvoiceDeliveryNote($invoice, $invoice->invitations->first()->contact);
|
||||
|
||||
$file_name = ctrans('texts.delivery_note'). " " .$invoice->getFileName();
|
||||
return response()->streamDownload(function () use ($file) {
|
||||
echo $file;
|
||||
}, basename($file), ['Content-Type' => 'application/pdf']);
|
||||
}, $file_name, ['Content-Type' => 'application/pdf']);
|
||||
|
||||
// return response()->streamDownload(function () use ($file) {
|
||||
// echo Storage::get($file);
|
||||
// }, basename($file), ['Content-Type' => 'application/pdf']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user