Commit 089768ea authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Amélioration pieces justificatives pour une meilleure gestion des doubles...

Amélioration pieces justificatives pour une meilleure gestion des doubles règles facultatives et Obligatoire FC
parent 77f1f00e
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -558,7 +558,6 @@ CREATE OR REPLACE PACKAGE BODY OSE_WORKFLOW AS
            WHEN e.code = ''PJ_VALIDATION'' THEN pj.demandees
          END                                                       objectif,
          CASE
			WHEN pj.obligatoire = 0 THEN 1
            WHEN e.code = ''PJ_SAISIE'' THEN pj.fournies
            WHEN e.code = ''PJ_VALIDATION'' THEN pj.validees
          END                                                       realisation
@@ -567,9 +566,9 @@ CREATE OR REPLACE PACKAGE BODY OSE_WORKFLOW AS
          SELECT
            intervenant_id,
            SUM(demandee) demandees,
            SUM(fournie)  fournies,
            SUM(validee)  validees,
			MIN(obligatoire) obligatoire
            SUM(CASE WHEN obligatoire = 0 THEN 1 ELSE fournie END)  fournies,
            SUM(CASE WHEN obligatoire = 0 THEN 1 ELSE validee END)  validees,
			SUM(CASE WHEN obligatoire = 0 THEN 1 ELSE 0 END) facultatives
          FROM
            tbl_piece_jointe
          WHERE
+5 −7
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@ WITH t AS (
    pjd.type_piece_jointe_id                                    type_piece_jointe_id,
    pjd.intervenant_id                                          intervenant_id,
    CASE WHEN pjd.intervenant_id IS NULL THEN 0 ELSE 1 END      demandee,
    SUM(CASE WHEN pjf.id IS NULL THEN 0 ELSE 1 END)             fournie,
    MAX(pjf.validation_id) keep(DENSE_RANK FIRST ORDER BY pjf.annee_id DESC) validee,
    SUM(CASE WHEN pjf.id IS NOT NULL THEN 1 ELSE 0 END)             fournie,
    MAX(pjf.validation_id) KEEP(DENSE_RANK FIRST ORDER BY pjf.annee_id DESC) validee,
    COALESCE(pjd.heures_pour_seuil,0)                           heures_pour_seuil,
    COALESCE(pjd.obligatoire,1)                                 obligatoire
  FROM
@@ -29,7 +29,7 @@ WITH t AS (
    pjf.intervenant_id                                          intervenant_id,
    0                                                           demandee,
    1                                                           fournie,
    MAX(pjf.validation_id) keep(DENSE_RANK FIRST ORDER BY pjf.annee_id DESC) validee,
    MAX(pjf.validation_id) KEEP(DENSE_RANK FIRST ORDER BY pjf.annee_id DESC) validee,
    0                                                           heures_pour_seuil,
    0                                                           obligatoire
  FROM
@@ -43,8 +43,7 @@ WITH t AS (
  GROUP BY
    pjf.annee_id, pjf.type_piece_jointe_id, pjf.intervenant_id
)
SELECT
  annee_id,
SELECT annee_id,
       type_piece_jointe_id,
       intervenant_id,
       demandee,
@@ -52,5 +51,4 @@ SELECT
       CASE WHEN validee IS NULL THEN 0 ELSE 1 END validee,
       heures_pour_seuil,
       obligatoire
FROM
  t
 No newline at end of file
FROM t
 No newline at end of file
+3 −5
Original line number Diff line number Diff line
CREATE
OR REPLACE FORCE VIEW V_TBL_PIECE_JOINTE_DEMANDE AS
CREATE OR REPLACE FORCE VIEW V_TBL_PIECE_JOINTE_DEMANDE AS
WITH i_h AS (
  SELECT
    s.intervenant_id,
@@ -37,7 +36,7 @@ SELECT i.annee_id annee_id,
       i.id                              intervenant_id,
       tpj.id                            type_piece_jointe_id,
       MAX(COALESCE(i_h.heures, 0))      heures_pour_seuil,
       tpjs.obligatoire                  obligatoire,
       MAX(tpjs.obligatoire)             obligatoire,
       MAX(COALESCE(hetd.total_hetd, 0)) heures_pour_seuil_hetd
FROM intervenant i

@@ -80,5 +79,4 @@ WHERE
GROUP BY i.annee_id,
         i.id,
         i.code,
         tpj.id,
         tpjs.obligatoire
 No newline at end of file
         tpj.id
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ class PieceJointeController extends AbstractController
        $msgs = [];

        if (0 == $nbDemandees) {
            $msgs['info'][] = 'Aucune pièce justificative n\'est à fournir';
            $msgs['info'][] = 'Aucune pièce justificative obligatoire n\'est à fournir';
        } elseif ($nbFournies < $nbDemandees) {
            $msgs['danger'][] = "Des pièces justificatives obligatoires n'ont pas été fournies.";
        } elseif ($nbFournies == $nbDemandees && $nbValidees == $nbDemandees) {
+4 −1
Original line number Diff line number Diff line
@@ -81,9 +81,12 @@ class MailService extends AbstractService
            ->setFrom($from)
            ->setSubject($subject)
            ->addTo($to)
            ->addBcc($copy)
            ->setBody($body);

        if (!empty($copy)) {
            $message->addBcc($copy);
        }

        //Envoi du mail
        $this->getMail()->send($message);
    }