Commit 62b3c347 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge remote-tracking branch 'origin/b23' into b23

parents 4f227b04 b34aa57c
Loading
Loading
Loading
Loading
+2 −2
Changes for data/ddl/package/OSE_DIVERS/body.sql: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -107,13 +107,13 @@ CREATE OR REPLACE PACKAGE BODY "OSE_DIVERS" AS
      UPDATE structure SET enseignement = 1 WHERE id = str.id;
    END LOOP;

    -- On retire les CC par défaut qui ne sont plus valables
    -- On retire les CC par défaut qui ne sont plus valables (historisé) ou si la structure n'est pas raccorchée au centre de cout
    FOR str IN (
      SELECT
        str.id
      FROM
        structure str
        LEFT JOIN centre_cout_structure ccs ON ccs.structure_id = str.id AND ccs.histo_destruction IS NULL
        LEFT JOIN centre_cout_structure ccs ON str.centre_cout_id = ccs.centre_cout_id AND ccs.structure_id = str.id AND ccs.histo_destruction IS NULL
        LEFT JOIN centre_cout cc ON cc.id = ccs.centre_cout_id AND cc.histo_destruction IS NULL
      WHERE
        str.centre_cout_id IS NOT NULL
+2 −1
Changes for data/ddl/view/V_CONTRAT_SERVICES.sql: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -25,13 +25,14 @@ WITH services AS (
            JOIN element_pedagogique ep ON ep.id = s.element_pedagogique_id
            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
            LEFT 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
        WHERE
            vh.histo_destruction IS NULL
            AND tvh.code = 'PREVU'
            AND (v.id IS NOT NULL OR vh.auto_validation = 1)
            AND (vvh.validation_id IS NOT NULL OR vh.auto_validation = 1)
        GROUP BY
            s.intervenant_id,
            c.id,
+221 −93

File changed.

Preview size limit exceeded, changes collapsed.

+2 −10
Changes for data/ddl/view/V_IMPUTATION_BUDGETAIRE_SIHAM.sql: 2 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -12,18 +12,10 @@ SELECT
	fonds,
	poste_reservation_credit,
	--On impact le potentiel écart de pourcentage détecté pour s'assurer que la somme des pourcentages fasse 100%
 	to_char((CASE
                WHEN pourc_ecart >= 0 THEN
 	CASE
	    WHEN rank() OVER (PARTITION BY periode_id, intervenant_id   ORDER BY operation,centre_cout, pourcentage) = 1
	    THEN pourcentage + pourc_ecart
                        ELSE pourcentage END
                ELSE
                    CASE
                        WHEN rank() OVER (PARTITION BY periode_id, intervenant_id   ORDER BY operation, centre_cout, pourcentage) = 1
                        THEN pourcentage - pourc_ecart
                        ELSE pourcentage END
       END))	pourcentage,
	    ELSE pourcentage END    	                                                                                          pourcentage,
     nombres_heures,
     flmodi,
     numord,
@@ -52,7 +44,7 @@ FROM (
	       NULL                                                                               										fonds,
	       NULL                                                                               										poste_reservation_credit,
	       CASE WHEN montant_hetd > 0
	       	    THEN ROUND(montant_hetd / SUM(montant_hetd) OVER( PARTITION BY periode_id,intervenant_id),2)*100
	       	    THEN ROUND(montant_hetd / SUM(montant_hetd) OVER( PARTITION BY periode_id,intervenant_id)*100,2)
	       	    ELSE 0  END																											pourcentage,
	       CASE WHEN hetd >= 100 THEN FLOOR(hetd) || ':' || lpad(FLOOR((hetd - FLOOR(hetd)) * 60), 2, 0)
	       ELSE (lpad(FLOOR(hetd), 2, '0')) || ':' || lpad(FLOOR((hetd - FLOOR(hetd)) * 60), 2, 0) END         						nombres_heures,
+3 −11

File changed.

Preview size limit exceeded, changes collapsed.

Loading