From a028b0e737658a4be2b9b935c6f0b85e5a945fce Mon Sep 17 00:00:00 2001
From: Jean-Philippe Metivier <jean-philippe.metivier@unicaen.fr>
Date: Wed, 27 Nov 2024 16:34:12 +0100
Subject: [PATCH] =?UTF-8?q?Correction=20du=20calcul=20de=20disponibilit?=
 =?UTF-8?q?=C3=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../src/Formation/Service/Inscription/InscriptionService.php   | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/module/Formation/src/Formation/Service/Inscription/InscriptionService.php b/module/Formation/src/Formation/Service/Inscription/InscriptionService.php
index ffec255e..d8128daa 100644
--- a/module/Formation/src/Formation/Service/Inscription/InscriptionService.php
+++ b/module/Formation/src/Formation/Service/Inscription/InscriptionService.php
@@ -359,11 +359,14 @@ class InscriptionService
 
     public function checkDisponibiliteAgent(?Agent $agent, Seance $seance) : array
     {
+        if ($seance->getType() === Seance::TYPE_VOLUME) return [];
+
         $probleme = [];
         $inscriptions = $this->getInscriptionsByAgent($agent);
         $inscriptions = array_filter($inscriptions, function (Inscription $inscription) { return !$inscription->isEtatActif(InscriptionEtats::ETAT_DESISTEMENT);});
         foreach ($inscriptions as $inscription) {
             $seances = $inscription->getSession()->getSeances();
+            $seances = array_filter($seances, function (Seance $s) { return $s->getType() !== Seance::TYPE_VOLUME; });
             foreach ($seances as $sessionSeance) {
                 if (Seance::hasIntersectionNonNulle($seance, $sessionSeance)) $probleme[$seance->getId()] = $sessionSeance;
             }
-- 
GitLab