Skip to content
Snippets Groups Projects
Commit a7e8e873 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Fixing transformation

parent 9e8b0525
Branches
No related tags found
No related merge requests found
......@@ -40,6 +40,19 @@ create index formation_action_referent_referent_id_index on formation_action_
alter table formation_presence add volume float;
```
Réécriture des volumes suivis en fonction de la présence ou non de l'agent
```postgresql
UPDATE formation_presence p
SET volume = CASE
WHEN p.statut = 'PRESENCE' THEN s.volume
ELSE 0
END
FROM formation_seance s
WHERE p.journee_id = s.id
AND s.type = 'VOLUME'
;
```
```postgresql
INSERT INTO notification_configuration (template_id, module, contexte, description, actif, histo_creation, histo_createur_id, histo_modification, histo_modificateur_id, histo_destruction, histo_destructeur_id, ordre) VALUES (18, 'SESSION', 'Inscription par un·e gesionnaire', 'Notification vers l''inscrit·e lors de l''inscription par un·e gestionnaire', true, '2025-05-20 09:53:20.134476', 0, null, null, null, null, 1700);
```
......
......@@ -489,51 +489,29 @@ class DemandeExterneService
$this->getEtatInstanceService()->setEtatActif($inscription, InscriptionEtats::ETAT_VALIDER_DRH);
$this->getInscriptionService()->update($inscription);
$absence = $volume - $suivi;
if ($suivi != 0) {
//seance
$seance = new Seance();
$seance->setInstance($session);
$seance->setVolume($suivi);
$seance->setVolume($volume);
$seance->setLieu(null);
$seance->setType(Seance::TYPE_VOLUME);
$seance->setVolumeDebut($demande->getDebut());
$seance->setVolumeFin($demande->getFin());
$inscription->setSource(HasSourceInterface::SOURCE_EMC2);
$this->getSeanceService()->create($seance);
$seance->setIdSource($formation->getId() . "-" . $session->getId() . "-" . $seance->getId());
$this->getSeanceService()->update($seance);
//presence true
$presence = new Presence();
$presence->setJournee($seance);
$presence->setInscription($inscription);
$presence->setStatut(Presence::PRESENCE_PRESENCE);
$presence->setPresenceType("stage externe");
//source ... todo
$this->getPresenceService()->create($presence);
}
$statut = Presence::PRESENCE_PARTIAL;
if ($suivi == $volume) $statut = Presence::PRESENCE_PRESENCE;
if ($suivi == 0) $statut = Presence::PRESENCE_ABSENCE;
if ($absence != 0) {
//seance
$seance = new Seance();
$seance->setInstance($session);
$seance->setVolume($absence);
$seance->setLieu(null);
$seance->setType(Seance::TYPE_VOLUME);
//source ... todo
$this->getSeanceService()->create($seance);
//presence false
//presence true
$presence = new Presence();
$presence->setJournee($seance);
$presence->setInscription($inscription);
$presence->setStatut(Presence::PRESENCE_ABSENCE_JUSTIFIEE);
$presence->setStatut($statut);
$presence->setVolumeSuivi($suivi);
$presence->setPresenceType("stage externe");
//source ... todo
$this->getPresenceService()->create($presence);
}
$demande->setInscription($inscription);
$this->update($demande);
......
......@@ -15,6 +15,8 @@ class Presence implements HistoriqueAwareInterface, HasSourceInterface
const PRESENCE_NON_RENSEIGNEE = "NON_RENSEIGNEE";
const PRESENCE_PRESENCE = "PRESENCE";
const PRESENCE_PARTIAL = "PARTIEL";
const PRESENCE_ABSENCE = "ABSENCE";
const PRESENCE_ABSENCE_JUSTIFIEE = "ABSENCE_JUSTIFIEE";
const PRESENCE_ABSENCE_NON_JUSTIFIEE = "ABSENCE_NON_JUSTIFIEE";
const PRESENCE_VOLUME = "VOLUME";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment