mirror of
https://github.com/crater-invoice/crater.git
synced 2025-12-15 01:42:54 -05:00
Added preview to invoice, estimate & payment pdfs
This commit is contained in:
@@ -27,6 +27,7 @@ class Invoice extends Model implements HasMedia
|
||||
|
||||
public const STATUS_DRAFT = 'DRAFT';
|
||||
public const STATUS_SENT = 'SENT';
|
||||
public const STATUS_OVERDUE = 'OVERDUE';
|
||||
public const STATUS_VIEWED = 'VIEWED';
|
||||
public const STATUS_COMPLETED = 'COMPLETED';
|
||||
|
||||
@@ -575,6 +576,10 @@ class Invoice extends Model implements HasMedia
|
||||
'taxes' => $taxes,
|
||||
]);
|
||||
|
||||
if (request()->has('preview')) {
|
||||
return view('app.pdf.invoice.'.$invoiceTemplate);
|
||||
}
|
||||
|
||||
return PDF::loadView('app.pdf.invoice.'.$invoiceTemplate);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user