mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04: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);
|
return response()->json(['message' => 'no record found'], 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
$contact = $invitation->contact;
|
|
||||||
$invoice = $invitation->recurring_invoice;
|
$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'];
|
$headers = ['Content-Type' => 'application/pdf'];
|
||||||
|
|
||||||
@ -577,8 +578,9 @@ class RecurringInvoiceController 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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user