From 41c9ae6bd9d621d79a2763ec8891cbb718d594a7 Mon Sep 17 00:00:00 2001 From: Bart Elferink Date: Wed, 2 Dec 2020 11:37:49 +0100 Subject: [PATCH] feature #231 --- src/Controller/AppDossierController.php | 5 +++++ src/Entity/Dossier.php | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Controller/AppDossierController.php b/src/Controller/AppDossierController.php index 869b3085..d4d94ec5 100644 --- a/src/Controller/AppDossierController.php +++ b/src/Controller/AppDossierController.php @@ -193,6 +193,11 @@ public function createAction(Request $request, EntityManagerInterface $em, Event $this->addFlash('success', sprintf('Info: Er bestaat al een ander dossier met deze BSN binnen %s', $dossier->getSchuldhulpbureau()->getNaam())); } + $dossiers = $dossierRepository->findBy(['regasNummer'=>$dossier->getRegasNummer(), 'schuldhulpbureau'=>$dossier->getSchuldhulpbureau()]); + if (count($dossiers) > 1) { + $this->addFlash('success', sprintf('Info: Er bestaat al een ander dossier met dit Regas nummer binnen %s', $dossier->getSchuldhulpbureau()->getNaam())); + } + if (!$allegroCheck) { $this->addFlash('success', 'Dossier aangemaakt'); } else { diff --git a/src/Entity/Dossier.php b/src/Entity/Dossier.php index 56c52a47..366d6b60 100644 --- a/src/Entity/Dossier.php +++ b/src/Entity/Dossier.php @@ -13,7 +13,6 @@ /** * @ORM\Entity(repositoryClass="GemeenteAmsterdam\FixxxSchuldhulp\Repository\DossierRepository") * @ORM\Table - * @UniqueEntity("regasNummer") * @UniqueEntity("allegroNummer") */ class Dossier