Commit 3527c5df authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Ajout d'une option pour calculer les seuils d'heures des pièces jointes par...

Ajout d'une option pour calculer les seuils d'heures des pièces jointes par statuts en équivalent HETD (#42094)
parent f108185d
Loading
Loading
Loading
Loading
+21 −4
Changes for data/ddl/package/UNICAEN_TBL/body.sql: 21 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -1587,6 +1587,19 @@ CREATE OR REPLACE PACKAGE BODY "UNICAEN_TBL" AS
            /*@INTERVENANT_ID=s.intervenant_id*/
          GROUP BY
            s.intervenant_id
        ),
        hetd AS (
            SELECT
                intervenant_id,
                SUM(total) AS total_hetd
            from
                formule_resultat   fr
            JOIN type_volume_horaire tvh ON tvh.id = fr.type_volume_horaire_id
            JOIN etat_volume_horaire evh ON evh.id = fr.etat_volume_horaire_id
                where
                tvh.code = ''PREVU''
            GROUP BY
                intervenant_id
        )
        SELECT
          i.annee_id                      annee_id,
@@ -1594,7 +1607,8 @@ CREATE OR REPLACE PACKAGE BODY "UNICAEN_TBL" AS
          i.id                            intervenant_id,
          tpj.id                          type_piece_jointe_id,
          MAX(COALESCE(i_h.heures, 0))    heures_pour_seuil,
          tpjs.obligatoire obligatoire
          tpjs.obligatoire obligatoire,
          MAX(COALESCE(hetd.total_hetd, 0))    heures_pour_seuil_hetd
        FROM
                    intervenant                 i

@@ -1609,15 +1623,17 @@ CREATE OR REPLACE PACKAGE BODY "UNICAEN_TBL" AS
                                                 AND tpj.histo_destruction IS NULL

          LEFT JOIN                           i_h ON i_h.intervenant_id = i.id
          LEFT JOIN 						  hetd ON hetd.intervenant_id = i.id
        WHERE
          -- Gestion de l''historique
          i.histo_destruction IS NULL
          /*@INTERVENANT_ID=i.id*/
          /*@ANNEE_ID=i.annee_id*/

          -- Seuil HETD ou PJ obligatoire meme avec des heures non payables
          AND (COALESCE(i_h.heures,0) > COALESCE(tpjs.seuil_hetd,-1) OR (COALESCE(i_h.heures_non_payables,0) > 0 AND tpjs.obligatoire_hnp = 1 ))

          -- Seuil heure soit en HETD soit en heure ou PJ obligatoire meme avec des heures non payables
            AND ((COALESCE(tpjs.type_heure_hetd,0) = 0 AND COALESCE(i_h.heures,0) > COALESCE(tpjs.seuil_hetd,-1))
                OR (tpjs.type_heure_hetd = 1  AND COALESCE(hetd.total_hetd,0) > COALESCE(tpjs.seuil_hetd,-1))
                OR (COALESCE(i_h.heures_non_payables,0) > 0 AND tpjs.obligatoire_hnp = 1 ))

          -- Le RIB n''est demandé QUE s''il est différent!!
          AND CASE
@@ -1643,6 +1659,7 @@ CREATE OR REPLACE PACKAGE BODY "UNICAEN_TBL" AS
        AND t.TYPE_PIECE_JOINTE_ID             = v.TYPE_PIECE_JOINTE_ID
        AND t.HEURES_POUR_SEUIL                = v.HEURES_POUR_SEUIL
        AND COALESCE(t.OBLIGATOIRE,0)          = COALESCE(v.OBLIGATOIRE,0)
        AND t.HEURES_POUR_SEUIL_HETD           = v.HEURES_POUR_SEUIL_HETD
      THEN -1 ELSE t.ID END ID,
      v.ANNEE_ID,
      v.CODE_INTERVENANT,
+12 −0
Changes for data/ddl/table/TBL_PIECE_JOINTE_DEMANDE.php: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -93,6 +93,18 @@ return [
            'position'    => 5,
            'commentaire' => NULL,
        ],
        'HEURES_POUR_SEUIL_HETD'    => [
            'name'        => 'HEURES_POUR_SEUIL_HETD',
            'type'        => 'float',
            'bdd-type'    => 'FLOAT',
            'length'      => 0,
            'scale'       => NULL,
            'precision'   => 126,
            'nullable'    => FALSE,
            'default'     => '0',
            'position'    => 8,
            'commentaire' => NULL,
        ],
    ],
];

+12 −0
Changes for data/ddl/table/TYPE_PIECE_JOINTE_STATUT.php: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -189,6 +189,18 @@ return [
            'position'    => 5,
            'commentaire' => NULL,
        ],
        'TYPE_HEURE_HETD'        => [
            'name'        => 'TYPE_HEURE_HETD',
            'type'        => 'bool',
            'bdd-type'    => 'NUMBER',
            'length'      => 0,
            'scale'       => '0',
            'precision'   => 1,
            'nullable'    => FALSE,
            'default'     => '0',
            'position'    => 18,
            'commentaire' => NULL,
        ],
        'STATUT_INTERVENANT_ID' => [
            'name'        => 'STATUT_INTERVENANT_ID',
            'type'        => 'int',
+20 −3
Changes for data/ddl/view/V_TBL_PIECE_JOINTE_DEMANDE.sql: 20 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -17,6 +17,19 @@ WITH i_h AS (
    /*@INTERVENANT_ID=s.intervenant_id*/
  GROUP BY
    s.intervenant_id
),
hetd AS (
	SELECT
		intervenant_id,
		SUM(total) AS total_hetd
	from
		formule_resultat   fr
	JOIN type_volume_horaire tvh ON tvh.id = fr.type_volume_horaire_id
	JOIN etat_volume_horaire evh ON evh.id = fr.etat_volume_horaire_id
		where
		tvh.code = 'PREVU'
	GROUP BY
		intervenant_id
)
SELECT
  i.annee_id                      annee_id,
@@ -24,7 +37,8 @@ SELECT
  i.id                            intervenant_id,
  tpj.id                          type_piece_jointe_id,
  MAX(COALESCE(i_h.heures, 0))    heures_pour_seuil,
  tpjs.obligatoire obligatoire
  tpjs.obligatoire obligatoire,
  MAX(COALESCE(hetd.total_hetd, 0))    heures_pour_seuil_hetd
FROM
            intervenant                 i

@@ -39,14 +53,17 @@ FROM
                                         AND tpj.histo_destruction IS NULL

  LEFT JOIN                           i_h ON i_h.intervenant_id = i.id
  LEFT JOIN 						  hetd ON hetd.intervenant_id = i.id
WHERE
  -- Gestion de l'historique
  i.histo_destruction IS NULL
  /*@INTERVENANT_ID=i.id*/
  /*@ANNEE_ID=i.annee_id*/

  -- Seuil HETD ou PJ obligatoire meme avec des heures non payables
  AND (COALESCE(i_h.heures,0) > COALESCE(tpjs.seuil_hetd,-1) OR (COALESCE(i_h.heures_non_payables,0) > 0 AND tpjs.obligatoire_hnp = 1 ))
  -- Seuil heure soit en HETD soit en heure ou PJ obligatoire meme avec des heures non payables
  AND ((COALESCE(tpjs.type_heure_hetd,0) = 0 AND COALESCE(i_h.heures,0) > COALESCE(tpjs.seuil_hetd,-1))
        OR (tpjs.type_heure_hetd = 1  AND COALESCE(hetd.total_hetd,0) > COALESCE(tpjs.seuil_hetd,-1))
        OR (COALESCE(i_h.heures_non_payables,0) > 0 AND tpjs.obligatoire_hnp = 1 ))


  -- Le RIB n'est demandé QUE s'il est différent!!
+1 −0
Changes for module/Application/src/Entity/Db/Mapping/Application.Entity.Db.TypePieceJointeStatut.dcm.xml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
        <field name="histoModification" type="datetime" column="HISTO_MODIFICATION" nullable="false"/>
        <field name="obligatoire" type="boolean" column="OBLIGATOIRE" nullable="false"/>
        <field name="seuilHetd" type="integer" column="SEUIL_HETD" nullable="true"/>
        <field name="typeHeureHetd" type="boolean" column="TYPE_HEURE_HETD" nullable="false"/>
        <field name="changementRIB" type="boolean" column="CHANGEMENT_RIB" nullable="false"/>
        <field name="fc" type="boolean" column="FC" nullable="false"/>
        <field name="dureeVie" type="integer" column="DUREE_VIE" nullable="true"/>
Loading