feat: add legacy PDF generation support and invoice discount fields
This commit is contained in:
@@ -56,6 +56,8 @@ class InvoiceController extends Controller
|
||||
'items.*.quantity' => 'required|integer|min:1',
|
||||
'items.*.unit_price' => 'required|numeric|min:0',
|
||||
'items.*.is_taxable' => 'nullable|boolean',
|
||||
'items.*.is_discountable' => 'nullable|boolean',
|
||||
'discount_rate' => 'nullable|integer|min:0|max:100',
|
||||
]);
|
||||
|
||||
$items = $validated['items'];
|
||||
@@ -118,6 +120,8 @@ class InvoiceController extends Controller
|
||||
'items.*.quantity' => 'required|integer|min:1',
|
||||
'items.*.unit_price' => 'required|numeric|min:0',
|
||||
'items.*.is_taxable' => 'nullable|boolean',
|
||||
'items.*.is_discountable' => 'nullable|boolean',
|
||||
'discount_rate' => 'nullable|integer|min:0|max:100',
|
||||
]);
|
||||
|
||||
$items = $validated['items'];
|
||||
@@ -151,4 +155,9 @@ class InvoiceController extends Controller
|
||||
{
|
||||
return $this->invoiceService->generatePdf($invoice);
|
||||
}
|
||||
|
||||
public function pdfLegacy(Invoice $invoice): Response
|
||||
{
|
||||
return $this->invoiceService->generateLegacyPdf($invoice);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user