Commit e21239a7 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Finalisation des enveloppes en euros pour les missions étudiantes par composante (80% et 90%)

parent c2f9e575
Loading
Loading
Loading
Loading
Loading
+5 −5
Changes for data/plafonds-sql/21.sql: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -3,19 +3,19 @@ SELECT
  s.id  						                    structure_id,
  MAX(i.id)                                         intervenant_id,
  vhm.type_volume_horaire_id 			 			type_volume_horaire_id,
  ROUND(SUM(vhm.heures * trv.valeur)) 				heures
  ROUND(SUM(vhm.heures * trv.valeur)*1.1) 				heures
FROM mission m
JOIN intervenant i ON i.id = m.intervenant_id
JOIN structure s ON s.id = m.structure_id
JOIN volume_horaire_mission vhm ON vhm.mission_id = m.id AND vhm.type_volume_horaire_id = 1
JOIN volume_horaire_mission vhm ON vhm.mission_id = m.id AND vhm.type_volume_horaire_id = 1 AND vhm.histo_destruction IS NULL
JOIN type_volume_horaire tvh ON tvh.id = vhm.type_volume_horaire_id
JOIN taux_remu tr  ON tr.id = m.taux_remu_id
JOIN taux_remu tr  ON tr.id = m.taux_remu_id AND (tr.histo_destruction IS NULL OR  tr.histo_destruction > m.date_debut)
JOIN taux_remu_valeur trv ON trv.taux_remu_id = COALESCE(tr.taux_remu_id, tr.id)
 AND trv.date_effet = (
      SELECT MAX(trv2.date_effet)
      FROM taux_remu_valeur trv2
      WHERE trv2.taux_remu_id = COALESCE(tr.taux_remu_id, tr.id)
        AND trv2.date_effet <= m.date_debut
 )
        AND trv2.date_effet <= m.date_debut )
WHERE m.histo_destruction IS NULL
GROUP BY
  i.annee_id,s.id, vhm.type_volume_horaire_id
 No newline at end of file
+20 −0
Changes for data/plafonds-sql/22.sql: 20 added lines, 0 removed lines.
Original line number Diff line number Diff line
SELECT
  i.annee_id      				                    annee_id,
  s.id  						                    structure_id,
  vhm.type_volume_horaire_id 			 			type_volume_horaire_id,
  ROUND(SUM(vhm.heures * trv.valeur)*1.1) 				heures
FROM mission m
JOIN intervenant i ON i.id = m.intervenant_id
JOIN structure s ON s.id = m.structure_id
JOIN volume_horaire_mission vhm ON vhm.mission_id = m.id AND vhm.type_volume_horaire_id = 1 AND vhm.histo_destruction IS NULL
JOIN type_volume_horaire tvh ON tvh.id = vhm.type_volume_horaire_id
JOIN taux_remu tr  ON tr.id = m.taux_remu_id AND (tr.histo_destruction IS NULL OR  tr.histo_destruction > m.date_debut)
JOIN taux_remu_valeur trv ON trv.taux_remu_id = COALESCE(tr.taux_remu_id, tr.id)
 AND trv.date_effet = (
      SELECT MAX(trv2.date_effet)
      FROM taux_remu_valeur trv2
      WHERE trv2.taux_remu_id = COALESCE(tr.taux_remu_id, tr.id)
        AND trv2.date_effet <= m.date_debut )
WHERE m.histo_destruction IS NULL
GROUP BY
  i.annee_id,s.id, vhm.type_volume_horaire_id
 No newline at end of file
+8 −2
Changes for data/plafonds.php: 8 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -68,10 +68,16 @@ return [
            'requete'   => file_get_contents($sqlDir . '19.sql'),
        ],
        21 => [
            'libelle' => 'Plafond enveloppe en € des missions étudiantes par composante',
            'libelle' => 'Plafond enveloppe informatif en € des missions étudiantes par composante (80%)',
            'perimetre' => 'structure',
            'message' => 'Enveloppe en € des missions étudiantes pour :sujet',
            'message' => 'Enveloppe en € des missions étudiantes (80%) pour :sujet',
            'requete' => file_get_contents($sqlDir . '21.sql'),
        ],
        22 => [
            'libelle' => 'Plafond enveloppe bloquant en € des missions étudiantes par composante (90%)',
            'perimetre' => 'structure',
            'message' => 'Enveloppe en € des missions étudiantes (90%) pour :sujet',
            'requete' => file_get_contents($sqlDir . '22.sql'),
        ],
    ],
];
 No newline at end of file
+4 −1
Changes for module/Plafond/src/Service/PlafondService.php: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -230,7 +230,10 @@ class PlafondService extends AbstractEntityService

        if ($entity instanceof Mission) {
            $this->controlePop($entity->getTypeMission(), $pqr);
            $this->controlePop($entity->getIntervenant(), $pqr);
            // Pour une mission, la structure à contrôler est celle de la mission.
            // Ajouter directement l'intervenant évite que controlePop() ne remonte
            // également vers sa structure d'affectation.
            $pqr->add($entity->getIntervenant());
            $this->controlePop($entity->getStructure(), $pqr);
        }

+1 −1
Changes for module/Plafond/view/plafond/plafond/config.phtml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ $autoSave = isset($autoSave) ? $autoSave : true;
        <th rowspan="2">Plafond</th>
        <th>Prévisionnel</th>
        <th>Réalisé</th>
        <th>Heures<sup>*</sup></th>
        <th>Heures ou euros </th>
    </tr>
    </thead>
    <tbody>
Loading