feat: add legacy PDF generation support and invoice discount fields
This commit is contained in:
@@ -59,4 +59,15 @@ final class InvoiceService
|
||||
|
||||
return $pdf->download("invoice-{$invoice->invoice_number}.pdf");
|
||||
}
|
||||
|
||||
public function generateLegacyPdf(Invoice $invoice): Response
|
||||
{
|
||||
$invoice->load('client', 'items');
|
||||
$invoiceSettings = InvoiceSettings::instance();
|
||||
|
||||
$pdf = Pdf::loadView('invoices.pdf-legacy', compact('invoice', 'invoiceSettings'));
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
|
||||
return $pdf->download("invoice-{$invoice->invoice_number}-legacy.pdf");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user