code cleanup (#3338)

This commit is contained in:
Kevin Papst
2022-05-31 18:08:41 +02:00
committed by GitHub
parent 88bf534573
commit 3f827b3104
5 changed files with 45 additions and 52 deletions

View File

@@ -355,7 +355,12 @@ final class ServiceInvoice
foreach ($this->getRenderer() as $renderer) {
if ($renderer->supports($document)) {
$dispatcher->dispatch(new InvoicePreRenderEvent($model, $document, $renderer));
$preEvent = new InvoicePreRenderEvent($model, $document, $renderer);
$dispatcher->dispatch($preEvent);
if ($preEvent->isPropagationStopped()) {
continue;
}
if ($this->invoiceRepository->hasInvoice($model->getInvoiceNumber())) {
throw new DuplicateInvoiceNumberException($model->getInvoiceNumber());