mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-01 21:00:58 +00:00
refactor(sales): rewrite legacy-era regions of the document services, controllers, credit-note request and routes in place
This commit is contained in:
@@ -18,19 +18,23 @@ class DocumentPdfController extends Controller
|
||||
|
||||
public function invoice(Request $request, Invoice $invoice)
|
||||
{
|
||||
if ($request->has('preview')) {
|
||||
if ($request->exists('preview')) {
|
||||
return $this->invoiceService->getPdfData($invoice);
|
||||
}
|
||||
|
||||
return $invoice->getGeneratedPDFOrStream('invoice');
|
||||
$pdf = $invoice->getGeneratedPDFOrStream('invoice');
|
||||
|
||||
return $pdf;
|
||||
}
|
||||
|
||||
public function estimate(Request $request, Estimate $estimate)
|
||||
{
|
||||
if ($request->has('preview')) {
|
||||
if ($request->exists('preview')) {
|
||||
return $this->estimateService->getPdfData($estimate);
|
||||
}
|
||||
|
||||
return $estimate->getGeneratedPDFOrStream('estimate');
|
||||
$pdf = $estimate->getGeneratedPDFOrStream('estimate');
|
||||
|
||||
return $pdf;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user