delete invoices (#1652)
* include all meta fields as template variables * support invoice preview via command * support deletion of generated invoices
This commit is contained in:
@@ -189,11 +189,26 @@ final class InvoiceController extends AbstractController
|
||||
{
|
||||
try {
|
||||
$this->service->changeInvoiceStatus($invoice, $status);
|
||||
} catch (\InvalidArgumentException $ex) {
|
||||
throw $this->createNotFoundException($ex->getMessage());
|
||||
$this->flashSuccess('action.update.success');
|
||||
} catch (\Exception $ex) {
|
||||
$this->flashError('action.update.error');
|
||||
}
|
||||
|
||||
$this->flashSuccess('action.update.success');
|
||||
return $this->redirectToRoute('admin_invoice_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route(path="/delete/{id}", name="admin_invoice_delete", methods={"GET"})
|
||||
* @Security("is_granted('history_invoice')")
|
||||
*/
|
||||
public function deleteInvoiceAction(Invoice $invoice): Response
|
||||
{
|
||||
try {
|
||||
$this->service->deleteInvoice($invoice);
|
||||
$this->flashSuccess('action.delete.success');
|
||||
} catch (\Exception $ex) {
|
||||
$this->flashError('action.delete.error');
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('admin_invoice_list');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user