Release 1.29 (#3622)
This commit is contained in:
@@ -525,13 +525,17 @@ final class InvoiceController extends AbstractController
|
||||
|
||||
foreach ($documentRepository->findBuiltIn() as $doc) {
|
||||
if ($doc->getId() === $id) {
|
||||
throw new \Exception('Document is built-in and cannot be deleted');
|
||||
$this->flashError('Document is built-in and cannot be deleted.');
|
||||
|
||||
return $this->redirectToRoute('admin_invoice_document_upload');
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->templateRepository->findAll() as $template) {
|
||||
if ($template->getRenderer() === $id) {
|
||||
throw new \Exception('Document is used and cannot be deleted');
|
||||
$this->flashError('Document is used and cannot be deleted.');
|
||||
|
||||
return $this->redirectToRoute('admin_invoice_document_upload');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user