Commit 6634c811 authored by Florian Joriot's avatar Florian Joriot
Browse files

Referentiel contrat possible avec enseignement

parent 71eccaf7
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
<?php

//@formatter:off

return [
    'name'    => 'TYPE_SERVICE_PK',
    'unique'  => TRUE,
    'table'   => 'TYPE_SERVICE',
    'columns' => [
        'ID',
    ],
];

//@formatter:on
+14 −0
Original line number Diff line number Diff line
<?php

//@formatter:off

return [
    'name'    => 'TYPE_SERVICE_PK',
    'table'   => 'TYPE_SERVICE',
    'index'   => 'TYPE_SERVICE_PK',
    'columns' => [
        'ID',
    ],
];

//@formatter:on
+51 −0
Original line number Diff line number Diff line
<?php

//@formatter:off

return [
    'name'        => 'TYPE_SERVICE',
    'temporary'   => FALSE,
    'logging'     => TRUE,
    'commentaire' => NULL,
    'sequence'    => NULL,
    'columns'     => [
        'CODE'    => [
            'name'        => 'CODE',
            'type'        => 'string',
            'bdd-type'    => 'VARCHAR2',
            'length'      => 20,
            'scale'       => NULL,
            'precision'   => NULL,
            'nullable'    => FALSE,
            'default'     => NULL,
            'position'    => 2,
            'commentaire' => NULL,
        ],
        'ID'      => [
            'name'        => 'ID',
            'type'        => 'int',
            'bdd-type'    => 'NUMBER',
            'length'      => 0,
            'scale'       => NULL,
            'precision'   => NULL,
            'nullable'    => FALSE,
            'default'     => NULL,
            'position'    => 1,
            'commentaire' => NULL,
        ],
        'LIBELLE' => [
            'name'        => 'LIBELLE',
            'type'        => 'string',
            'bdd-type'    => 'VARCHAR2',
            'length'      => 30,
            'scale'       => NULL,
            'precision'   => NULL,
            'nullable'    => TRUE,
            'default'     => NULL,
            'position'    => 3,
            'commentaire' => NULL,
        ],
    ],
];

//@formatter:on
+86 −23
Original line number Diff line number Diff line
CREATE OR REPLACE FORCE VIEW V_CONTRAT_SERVICES AS
WITH services AS (

        SELECT
            s.intervenant_id                                                            intervenant_id,
        ts.code                                                                     code,
            c.id                                                                        contrat_id,
            str.id                                                                      structure_id,
            str.libelle_court                                                           "serviceComposante",
            ep.code                                                                     "serviceCode",
            ep.libelle                                                                  "serviceLibelle",
            ep.id                                                                       element_pedagogique_id,
            NULL                                                                        fonction_referentiel_id,
            NULL                                                                        type_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,
            SUM(CASE WHEN ti.code NOT IN ('CM','TD','TP') THEN vh.heures ELSE 0 END)    heures_autres,
        SUM(vh.heures)                                                              heures_totales
            SUM(vh.heures)                                                              heures_totales,
            'ENS'                                                                       "typeServiceCode"
        FROM
            volume_horaire vh
            JOIN service s ON s.id = vh.service_id
@@ -20,9 +25,8 @@ WITH services AS (
            JOIN type_volume_horaire tvh ON tvh.id = vh.type_volume_horaire_id
            LEFT JOIN validation_vol_horaire vvh ON vvh.volume_horaire_id = vh.id
            JOIN validation v ON v.id = vvh.validation_id AND v.histo_destruction IS NULL
            JOIN structure str ON ep.structure_id = str.id
            LEFT JOIN contrat c ON c.id = vh.contrat_id
        LEFT JOIN structure str ON c.structure_id = str.id
        JOIN type_service ts ON ts.code = 'ENS'
        WHERE
            vh.histo_destruction IS NULL
            AND tvh.code = 'PREVU'
@@ -33,20 +37,29 @@ WITH services AS (
            str.libelle_court,
            ep.code,
            ep.libelle,
        ts.code
            str.id,
            ep.id


    UNION ALL


        SELECT
            sr.intervenant_id       intervenant_id,
        ts.code                 code,
            c.id                    contrat_id,
            str.id                  structure_id,
            str.libelle_court       "serviceComposante",
            fr.code                 "serviceCode",
            fr.libelle_long         "serviceLibelle",
            NULL                    element_pedagogique_id,
            fr.id                   fonction_referentiel_id,
            NULL                    type_mission_id,
            0                       heures_cm,
            0                       heures_td,
            0                       heures_tp,
            SUM(vhr.heures)         heures_autres,
        SUM(vhr.heures)         heures_totales
            SUM(vhr.heures)         heures_totales,
            'REF'                   "typeServiceCode"
        FROM
            volume_horaire_ref vhr
            JOIN service_referentiel sr ON sr.id = vhr.service_referentiel_id
@@ -55,8 +68,7 @@ WITH services AS (
            LEFT JOIN validation_vol_horaire_ref vvhr ON vvhr.volume_horaire_ref_id = vhr.id
            JOIN validation v ON v.id = vvhr.validation_id AND v.histo_destruction IS NULL
            LEFT JOIN contrat c ON c.id = vhr.contrat_id
        LEFT JOIN structure str ON c.structure_id = str.id
        JOIN type_service ts ON ts.code = 'REF'
            LEFT JOIN structure str ON sr.structure_id = str.id
        WHERE
            vhr.histo_destruction IS NULL
            AND tvh.code = 'PREVU'
@@ -65,22 +77,32 @@ WITH services AS (
            sr.intervenant_id,
            c.id,
            str.libelle_court,
        ts.code,
            fr.code,
        fr.libelle_long
            fr.libelle_long,
            str.id,
            fr.id



    UNION ALL


        SELECT
            m.intervenant_id        intervenant_id,
            ts.code                 code,
            c.id                    contrat_id,
            str.id                  structure_id,
            str.libelle_court       "serviceComposante",
            tm.code                 "serviceCode",
            tm.libelle              "serviceLibelle",
            NULL                    element_pedagogique_id,
            NULL                    fonction_referentiel_id,
            tm.id                   type_mission_id,
            0                       heures_cm,
            0                       heures_td,
            0                       heures_tp,
            SUM(vhm.heures)         heures_autres,
            SUM(vhm.heures)         heures_totales
            SUM(vhm.heures)         heures_totales,
            'MIS'                   "typeServiceCode"
 FROM
            volume_horaire_mission vhm
            JOIN mission m ON m.id = vhm.mission_id
@@ -90,7 +112,6 @@ WITH services AS (
            LEFT JOIN validation_vol_horaire_miss vvhm ON vvhm.volume_horaire_mission_id = vhm.id
            JOIN validation v ON v.id = vvhm.validation_id AND v.histo_destruction IS NULL
            JOIN type_volume_horaire tvh ON tvh.id = vhm.type_volume_horaire_id
            JOIN type_service ts ON ts.code = 'MIS'
        WHERE
            vhm.histo_destruction IS NULL
            AND tvh.code = 'PREVU'
@@ -99,29 +120,71 @@ WITH services AS (
            m.intervenant_id,
            c.id,
            str.libelle_court,
            ts.code,
            tm.code,
            tm.libelle
            tm.libelle,
            str.id,
            tm.id
        )

        SELECT
        s.intervenant_id,
        s.contrat_id,
        s."serviceComposante",
        s."serviceCode",
        s."serviceLibelle",
            rownum id,
            res.intervenant_id,
            res.contrat_id,
            res.type_service_id,
            res.structure_id,
            res."serviceCode"   service_code,
            res."serviceLibelle" service_libelle,
            res.element_pedagogique_id,
            res.fonction_referentiel_id,
            res.type_mission_id,
            res."cm" cm,
            res."td" td,
            res."tp" tp,
            res."autres" autres,
            res.heures,
            res."serviceHeures" service_heures,
            res."serviceComposante",
            res."serviceCode",
            res."serviceLibelle",
            res."cm",
            res."td",
            res."tp",
            res."autres",
            res."serviceHeures",
            res."typeService"
        FROM
        (
            SELECT
                s.intervenant_id                                                                                                                 intervenant_id,
                s.contrat_id                                                                                                                     contrat_id,
                ts.id                                                                                                                            type_service_id,
                s.structure_id                                                                                                                   structure_id,
                s."serviceComposante"                                                                                                            "serviceComposante",
                s."serviceCode"                                                                                                                  "serviceCode",
                s."serviceLibelle"                                                                                                               "serviceLibelle",
                s.element_pedagogique_id                                                                                                         element_pedagogique_id,
                s.fonction_referentiel_id                                                                                                        fonction_referentiel_id,
                s.type_mission_id                                                                                                                type_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",
                CASE WHEN SUM(s.heures_autres) = 0 THEN to_char(0) ELSE REPLACE(ltrim(to_char(SUM(s.heures_autres), '999999.00')),'.',',') END   "autres",
                SUM(heures_totales)                                                                                                              heures,
                SUM(heures_totales)                                                                                                              "serviceHeures",
        s.code                                                                                                                           "typeService"
                s."typeServiceCode"                                                                                                              "typeService"
            FROM
                services s
                JOIN TYPE_SERVICE ts ON ts.code = s."typeServiceCode"
            GROUP BY
                s.intervenant_id,
                s.contrat_id,
                s."serviceComposante",
                s."serviceCode",
                s."serviceLibelle",
        s.code
 No newline at end of file
                s."typeServiceCode",
                s.structure_id,
                ts.id,
                element_pedagogique_id,
                fonction_referentiel_id,
                type_mission_id
        ) res
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ namespace Contrat;
use Application\Provider\Privilege\Privileges;
use Contrat\Assertion\ContratAssertion;
use Contrat\Controller\ContratController;
use Contrat\Service\ContratServiceListeService;

return [
    'routes' => [
@@ -199,6 +200,7 @@ return [
        \Contrat\Service\ContratService::class             => \Contrat\Service\ContratServiceFactory::class,
        \Contrat\Service\TypeContratService::class         => \Contrat\Service\TypeContratServiceFactory::class,
        \Contrat\Processus\ContratProcessus::class         => \Contrat\Processus\ContratProcessusFactory::class,
        \Contrat\Service\ContratServiceListeService::class => \Contrat\Service\ContratServiceListeServiceFactory::class,
    ],
    'view_helpers' => [
    ],
Loading