Commit ca84540c authored by Florian Joriot's avatar Florian Joriot
Browse files

contrat mission + retour du bon taux dans v_contrat_main

parent 96419e86
Loading
Loading
Loading
Loading
+1 −0
Changes for data/ddl/index/CONTRAT_NUMERO_AVENANT_UN.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ return [
        'NUMERO_AVENANT',
        'VALIDATION_ID',
        'HISTO_DESTRUCTION',
        'MISSION_ID',
    ],
];

+36 −0
Changes for data/ddl/table/CONTRAT.php: 36 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -45,6 +45,30 @@ return [
            'position'    => 12,
            'commentaire' => NULL,
        ],
        'DEBUT_VALIDITE'        => [
            'name'        => 'DEBUT_VALIDITE',
            'type'        => 'date',
            'bdd-type'    => 'DATE',
            'length'      => 0,
            'scale'       => NULL,
            'precision'   => NULL,
            'nullable'    => TRUE,
            'default'     => NULL,
            'position'    => 18,
            'commentaire' => NULL,
        ],
        'FIN_VALIDITE'          => [
            'name'        => 'FIN_VALIDITE',
            'type'        => 'date',
            'bdd-type'    => 'DATE',
            'length'      => 0,
            'scale'       => NULL,
            'precision'   => NULL,
            'nullable'    => TRUE,
            'default'     => NULL,
            'position'    => 19,
            'commentaire' => NULL,
        ],
        'HISTO_CREATEUR_ID'     => [
            'name'        => 'HISTO_CREATEUR_ID',
            'type'        => 'int',
@@ -141,6 +165,18 @@ return [
            'position'    => 3,
            'commentaire' => NULL,
        ],
        'MISSION_ID'            => [
            'name'        => 'MISSION_ID',
            'type'        => 'string',
            'bdd-type'    => 'VARCHAR2',
            'length'      => 20,
            'scale'       => NULL,
            'precision'   => NULL,
            'nullable'    => TRUE,
            'default'     => NULL,
            'position'    => 17,
            'commentaire' => 'Utilisé pour la contrainte d\'unicité. Le service ne peut avoir qu\'un projet par structure mais les mission peuvent avoir deux projets de contrats dans la même structure si se sont des missions différentes',
        ],
        'NUMERO_AVENANT'        => [
            'name'        => 'NUMERO_AVENANT',
            'type'        => 'int',
+1 −0
Changes for data/ddl/unique-constraint/CONTRAT_NUMERO_AVENANT_UN.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ return [
        'NUMERO_AVENANT',
        'VALIDATION_ID',
        'HISTO_DESTRUCTION',
        'MISSION_ID',
    ],
];

+6 −2
Changes for data/ddl/view/V_CONTRAT_MAIN.sql: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ SELECT ct.annee_id,
       ct."totalHETD",
       ct."tauxHoraireValeur",
       ct."tauxHoraireDate",
       ct."tauxId",
       ct."dateSignature",
       ct."modifieComplete",
       CASE WHEN ct.est_contrat = 1 THEN 1 ELSE NULL END  "contrat1",
@@ -96,8 +97,9 @@ SELECT ct.annee_id,
             COALESCE(d.numero_insee, i.numero_insee)                                            "numInsee",
             si.libelle                                                                          "statut",
             REPLACE(ltrim(to_char(COALESCE(c.total_hetd, fr.total, 0), '999999.00')), '.', ',') "totalHETD",
             REPLACE(ltrim(to_char(COALESCE(OSE_PAIEMENT.get_taux_horaire(COALESCE(si.taux_remu_id,tr.id), a.date_debut), 0), '999999.00')), '.', ',')              "tauxHoraireValeur",
             COALESCE(to_char(OSE_PAIEMENT.get_taux_horaire_date(COALESCE(si.taux_remu_id,tr.id), a.date_debut), 'dd/mm/YYYY'), 'TAUX INTROUVABLE')              "tauxHoraireDate",
             REPLACE(ltrim(to_char(COALESCE(OSE_PAIEMENT.get_taux_horaire(COALESCE(tm.taux_remu_id, si.taux_remu_id,tr.id), a.date_debut), 0), '999999.00')), '.', ',')          "tauxHoraireValeur",
             COALESCE(to_char(OSE_PAIEMENT.get_taux_horaire_date(COALESCE(tm.taux_remu_id,si.taux_remu_id,tr.id), a.date_debut), 'dd/mm/YYYY'), 'TAUX INTROUVABLE')              "tauxHoraireDate",
             COALESCE(tm.taux_remu_id, si.taux_remu_id,tr.id)                                "tauxId",
             to_char(COALESCE(v.histo_creation, a.date_debut), 'dd/mm/YYYY')                 "dateSignature",
             CASE
                 WHEN c.structure_id <> COALESCE(cp.structure_id, 0) THEN 'modifié'
@@ -141,6 +143,8 @@ SELECT ct.annee_id,
    LEFT JOIN                      hs ON hs.contrat_id = c.id
    LEFT JOIN                      la ON la.contrat_id = c.id
    LEFT JOIN contrat              cp ON cp.id = c.contrat_id
    LEFT JOIN mission m on c.mission_id = m.id
    LEFT JOIN type_mission tm ON m.type_mission_id = tm.id
  WHERE
    c.histo_destruction IS NULL
) ct
 No newline at end of file
+9 −2
Changes for data/ddl/view/V_CONTRAT_SERVICES.sql: 9 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ WITH services AS (
            ep.id                                                                       element_pedagogique_id,
            NULL                                                                        fonction_referentiel_id,
            NULL                                                                        type_mission_id,
            NULL                                                                        mission_id,
            SUM(CASE WHEN ti.code = 'CM' THEN vh.heures ELSE 0 END)                     heures_cm,
            SUM(CASE WHEN ti.code = 'TD' THEN vh.heures ELSE 0 END)                     heures_td,
            SUM(CASE WHEN ti.code = 'TP' THEN vh.heures ELSE 0 END)                     heures_tp,
@@ -54,6 +55,7 @@ WITH services AS (
            NULL                    element_pedagogique_id,
            fr.id                   fonction_referentiel_id,
            NULL                    type_mission_id,
            NULL                    mission_id,
            0                       heures_cm,
            0                       heures_td,
            0                       heures_tp,
@@ -97,6 +99,7 @@ WITH services AS (
            NULL                    element_pedagogique_id,
            NULL                    fonction_referentiel_id,
            tm.id                   type_mission_id,
            m.id                    mission_id,
            0                       heures_cm,
            0                       heures_td,
            0                       heures_tp,
@@ -123,7 +126,8 @@ WITH services AS (
            tm.code,
            tm.libelle,
            str.id,
            tm.id
            tm.id,
            m.id
        )

        SELECT
@@ -137,6 +141,7 @@ WITH services AS (
            res.element_pedagogique_id,
            res.fonction_referentiel_id,
            res.type_mission_id,
            res.mission_id,
            res."cm" cm,
            res."td" td,
            res."tp" tp,
@@ -165,6 +170,7 @@ WITH services AS (
                s.element_pedagogique_id                                                                                                         element_pedagogique_id,
                s.fonction_referentiel_id                                                                                                        fonction_referentiel_id,
                s.type_mission_id                                                                                                                type_mission_id,
                s.mission_id                                                                                                                     mission_id,
                CASE WHEN SUM(s.heures_cm) = 0     THEN to_char(0) ELSE REPLACE(ltrim(to_char(SUM(s.heures_cm), '999999.00')),'.',',')     END   "cm",
                CASE WHEN SUM(s.heures_td) = 0     THEN to_char(0) ELSE REPLACE(ltrim(to_char(SUM(s.heures_td), '999999.00')),'.',',')     END   "td",
                CASE WHEN SUM(s.heures_tp) = 0     THEN to_char(0) ELSE REPLACE(ltrim(to_char(SUM(s.heures_tp), '999999.00')),'.',',')     END   "tp",
@@ -186,5 +192,6 @@ WITH services AS (
                ts.id,
                element_pedagogique_id,
                fonction_referentiel_id,
                type_mission_id
                type_mission_id,
                mission_id
        ) res
 No newline at end of file
Loading