Commit 56d7219c authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Ajout de la répartition AA/AC (calcul restant à effectuer) sur tbl_paiement

Ajout du domaine fonctionnel pour à terme supprimer v_mep_intervenant_structure et la remplacer par tbl_paiement
parent 5d59ebf3
Loading
Loading
Loading
Loading
+3 −1
Changes for admin/migration/OrdonnancementColonnesTbl.php: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -44,8 +44,10 @@ class OrdonnancementColonnesTbl extends AbstractMigration
            $pos   = (int)$tc['POSITION'];
            if (isset($tables[$table]['columns'][$col])) {
                if ($pos != $tables[$table]['columns'][$col]['position']) {
                    $this->tbls[$table] = true;
                    $this->tbls[$table] = true; // Position différente => la table sera recréée
                }
            } else {
                $this->tbls[$table] = true; // Nouvelle colonne => la table sera recréée
            }
        }

+36 −0
Changes for data/ddl/table/TBL_PAIEMENT.php: 36 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -21,6 +21,18 @@ return [
            'position'    => 2,
            'commentaire' => NULL,
        ],
        'DOMAINE_FONCTIONNEL_ID'        => [
            'name'        => 'DOMAINE_FONCTIONNEL_ID',
            'type'        => 'int',
            'bdd-type'    => 'NUMBER',
            'length'      => 0,
            'scale'       => '0',
            'precision'   => NULL,
            'nullable'    => TRUE,
            'default'     => NULL,
            'position'    => 10,
            'commentaire' => NULL,
        ],
        'FORMULE_RES_SERVICE_ID'     => [
            'name'        => 'FORMULE_RES_SERVICE_ID',
            'type'        => 'int',
@@ -141,6 +153,30 @@ return [
            'position'    => 10,
            'commentaire' => NULL,
        ],
        'POURC_EXERCICE_AA'         => [
            'name'        => 'POURC_EXERCICE_AA',
            'type'        => 'float',
            'bdd-type'    => 'FLOAT',
            'length'      => 0,
            'scale'       => NULL,
            'precision'   => 126,
            'nullable'    => FALSE,
            'default'     => '4/10',
            'position'    => 15,
            'commentaire' => NULL,
        ],
        'POURC_EXERCICE_AC'         => [
            'name'        => 'POURC_EXERCICE_AC',
            'type'        => 'float',
            'bdd-type'    => 'FLOAT',
            'length'      => 0,
            'scale'       => NULL,
            'precision'   => 126,
            'nullable'    => FALSE,
            'default'     => '6/10',
            'position'    => 16,
            'commentaire' => NULL,
        ],
        'SERVICE_ID'                 => [
            'name'        => 'SERVICE_ID',
            'type'        => 'int',
+13 −4
Changes for data/ddl/view/V_TBL_PAIEMENT.sql: 13 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -9,14 +9,18 @@ SELECT
  COALESCE( ep.structure_id, i.structure_id ) structure_id,
  mep.id                                      mise_en_paiement_id,
  mep.periode_paiement_id                     periode_paiement_id,
  COALESCE(mep.domaine_fonctionnel_id, e.domaine_fonctionnel_id, to_number(p.valeur)) domaine_fonctionnel_id,
  frs.heures_compl_fi + frs.heures_compl_fc + frs.heures_compl_fa + frs.heures_compl_fc_majorees heures_a_payer,
  count(*) OVER(PARTITION BY frs.id)          heures_a_payer_pond,
  NVL(mep.heures,0)                           heures_demandees,
  CASE WHEN mep.periode_paiement_id IS NULL THEN 0 ELSE mep.heures END heures_payees
  CASE WHEN mep.periode_paiement_id IS NULL THEN 0 ELSE mep.heures END heures_payees,
  4 / 10                                      pourc_exercice_aa,
  6 / 10                                      pourc_exercice_ac
FROM
            formule_resultat_service        frs
       JOIN type_volume_horaire             tvh ON tvh.code = 'REALISE'
       JOIN etat_volume_horaire             evh ON evh.code = 'valide'
       JOIN parametre                         p ON p.nom = 'domaine_fonctionnel_ens_ext'
       JOIN formule_resultat                 fr ON fr.id = frs.formule_resultat_id
                                               AND fr.type_volume_horaire_id = tvh.id
                                               AND fr.etat_volume_horaire_id = evh.id
@@ -24,6 +28,7 @@ FROM
       JOIN intervenant                       i ON i.id = fr.intervenant_id /*@INTERVENANT_ID=i.id*/ /*@ANNEE_ID=a.annee_id*/
       JOIN service                           s ON s.id = frs.service_id
  LEFT JOIN element_pedagogique              ep ON ep.id = s.element_pedagogique_id
  LEFT JOIN etape                             e ON e.id = ep.etape_id
  LEFT JOIN mise_en_paiement                mep ON mep.formule_res_service_id = frs.id
                                               AND mep.histo_destruction IS NULL

@@ -36,13 +41,16 @@ SELECT
  null                                        formule_res_service_id,
  frs.id                                      formule_res_service_ref_id,
  i.id                                        intervenant_id,
  s.structure_id                              structure_id,
  sr.structure_id                             structure_id,
  mep.id                                      mise_en_paiement_id,
  mep.periode_paiement_id                     periode_paiement_id,
  COALESCE(mep.domaine_fonctionnel_id, fncr.domaine_fonctionnel_id) domaine_fonctionnel_id,
  frs.heures_compl_referentiel                heures_a_payer,
  count(*) OVER(PARTITION BY frs.id)          heures_a_payer_pond,
  NVL(mep.heures,0)                           heures_demandees,
  CASE WHEN mep.periode_paiement_id IS NULL THEN 0 ELSE mep.heures END heures_payees
  CASE WHEN mep.periode_paiement_id IS NULL THEN 0 ELSE mep.heures END heures_payees,
  4 / 10                                      pourc_exercice_aa,
  6 / 10                                      pourc_exercice_ac
FROM
            formule_resultat_service_ref    frs
       JOIN type_volume_horaire             tvh ON tvh.code = 'REALISE'
@@ -52,6 +60,7 @@ FROM
                                               AND fr.etat_volume_horaire_id = evh.id

       JOIN intervenant                       i ON i.id = fr.intervenant_id /*@INTERVENANT_ID=i.id*/ /*@ANNEE_ID=a.annee_id*/
       JOIN service_referentiel               s ON s.id = frs.service_referentiel_id
       JOIN service_referentiel              sr ON sr.id = frs.service_referentiel_id
       JOIN fonction_referentiel           fncr ON fncr.id = sr.fonction_id
  LEFT JOIN mise_en_paiement                mep ON mep.formule_res_service_ref_id = frs.id
                                               AND mep.histo_destruction IS NULL
 No newline at end of file