Commit 83f91520 authored by Florian Joriot's avatar Florian Joriot
Browse files

Mise en place du contrat de referentiel et du contrat mission

parent 024116b2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -13,10 +13,16 @@

# OSE 20.2 (à venir)

## Nouveautés

* Nouvelle formule de calcul de Rouen

## Corrections de bugs

* Les motifs de modification de service dû supprimés ne peuvent plus être sélectionnés #50328
* Messages d'erreur corrigés lors de l'exécution du script de migration de la V20.
* Le bouton prévu=>réalisé s'affiche de nouveau lorsqu'il n'y a pas de contrat (#45643)
* Formule de Poitiers : rétablissement du test pour appliquer l'ancienne formule avant 2022.

# OSE 20.1 (04/04/2023)

+20 −0
Original line number Diff line number Diff line
@@ -35,6 +35,26 @@ WITH t AS (
    /*@INTERVENANT_ID=i.id*/
    /*@ANNEE_ID=i.annee_id*/
    AND NOT (si.contrat = 0 AND evh.code = 'valide')

  UNION

  SELECT
    m.annee_id        annee_id,
    m.intervenant_id  intervenant_id,
    1                 actif,
    m.structure_id    structure_id,
    CASE WHEN evh.code IN ('contrat-edite','contrat-signe') THEN 1 ELSE 0 END edite,
    CASE WHEN evh.code IN ('contrat-signe')                 THEN 1 ELSE 0 END signe
  FROM
    tbl_mission m
    LEFT JOIN volume_horaire_mission vhm ON vhm.mission_id = m.mission_id AND vhm.histo_destruction IS NULL
    JOIN V_VOLUME_HORAIRE_MISSION_ETAT vvhme ON vvhme.volume_horaire_mission_id = vhm.id
    JOIN etat_volume_horaire       evh ON evh.id = vvhme.etat_volume_horaire_id
                                      AND evh.code IN ('valide', 'contrat-edite', 'contrat-signe')
  WHERE
    1=1
    /*@INTERVENANT_ID=m.intervenant_id*/
    /*@ANNEE_ID=m.annee_id*/
)
SELECT
  annee_id,
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ FROM
        i.annee_id                          annee_id,
        fr.type_volume_horaire_id           type_volume_horaire_id,
        i.id                                intervenant_id,
        fr.heures_compl_fc_majorees         heures
        fr.heures_compl_fc_majorees * a.taux_hetd         heures
        /*ROUND( (COALESCE(si.plafond_hc_remu_fc,0) - COALESCE(i.montant_indemnite_fc,0)) / a.taux_hetd, 2 ) plafond*/

      FROM
+2 −3
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ SELECT
  CASE WHEN p.heures > COALESCE(p.PLAFOND,ps.heures,0) + COALESCE(pd.heures, 0) + 0.05 THEN 1 ELSE 0 END depassement
FROM
  (
  SELECT 5 PLAFOND_ID, p.* FROM (
  SELECT 5 PLAFOND_ID, NULL PLAFOND_ETAT_ID, p.* FROM (
    WITH c AS (
        SELECT
          vhe.element_pedagogique_id,
@@ -61,8 +61,7 @@ FROM
        s.element_pedagogique_id                    element_pedagogique_id,
        s.type_intervention_id                      type_intervention_id,
        s.heures                                    heures,
        COALESCE(c.heures * c.groupes,0)            plafond,
            2 plafond_etat_id
        COALESCE(c.heures * c.groupes,0)            plafond
      FROM
                  s
             JOIN type_intervention ti ON ti.id = s.type_intervention_id
+2 −2
Original line number Diff line number Diff line
CREATE OR REPLACE FORCE VIEW V_VOLUME_HORAIRE_REF_ETAT AS
SELECT DISTINCT
SELECT
  vhr.id volume_horaire_ref_id,
  evh.id etat_volume_horaire_id
FROM
  volume_horaire_ref vhr
  LEFT JOIN validation_vol_horaire_ref vvhr ON vvhr.volume_horaire_ref_id = vhr.id
  LEFT JOIN validation v ON v.id = vvhr.validation_id AND v.histo_destruction IS NULL
  JOIN validation v ON v.id = vvhr.validation_id AND v.histo_destruction IS NULL
  JOIN etat_volume_horaire evh ON evh.code = CASE WHEN vhr.auto_validation = 1 OR v.id IS NOT NULL THEN 'valide' ELSE 'saisi' END
 No newline at end of file
Loading