fix deleting invoice documents (#2980)

This commit is contained in:
Kevin Papst
2021-11-29 15:57:39 +01:00
committed by GitHub
parent d994339de5
commit 9491f07ade
3 changed files with 9 additions and 5 deletions

View File

@@ -443,8 +443,8 @@ final class InvoiceController extends AbstractController
$csrfTokenManager->refreshToken('invoice.delete_document');
foreach ($documentRepository->findBuiltIn() as $document) {
if ($document->getId() === $id) {
foreach ($documentRepository->findBuiltIn() as $doc) {
if ($doc->getId() === $id) {
throw new \Exception('Document is built-in and cannot be deleted');
}
}