Commit 1af337e3 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Merge branch 'master' into alc-tags

parents fa7a7f74 277c688e
Loading
Loading
Loading
Loading
+3 −1
Changes for CHANGELOG.md: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@



# OSE 19.5 (à venir)
# OSE 19.5 (12/12/2022)

## Corrections de bugs

@@ -57,6 +57,8 @@
* Ajout du libelle du statut (champ STATUT_LIBELLE) pour affichage dans les états de paiement si nécessaire (#47762)
* Correction pour prise en compte des départements de naissance dans les DOM TOM dans la PEC Siham.
* Le workflow se calcule correctement lorsqu'il n'y a qu'un seul contrat par intervenant
* Correction sur la gestion des pièces jointes demandées uniquement dans le cadre de la formation continue
* Formule de calcul de ROUEN corrigée (#47876)

# OSE 19.4 (21/10/2022)

+2 −2
Changes for data/ddl/package/FORMULE_ROUEN/body.sql: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -186,12 +186,12 @@ CREATE OR REPLACE PACKAGE BODY FORMULE_ROUEN AS



      -- AA=IF([.$I20]="Référentiel";0;([.$AL20]+[.$AX20])*[.H20])
      -- AA=IF([.$I20]="Référentiel";0;([.$AL20]+[.$AR20])*[.H20])
      WHEN 'AA' THEN
        IF vh.volume_horaire_ref_id IS NOT NULL THEN
          RETURN 0;
        ELSE
          RETURN (cell('AL',l) + cell('AX',l)) * vh.taux_fc;
          RETURN (cell('AL',l) + cell('AR',l)) * vh.taux_fc;
        END IF;


+14 −13
Changes for data/ddl/view/V_TBL_PIECE_JOINTE_DEMANDE.sql: 14 added lines, 13 removed lines.
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,
    SUM(CASE WHEN vh.MOTIF_NON_PAIEMENT_ID IS NULL THEN vh.heures ELSE 0 END) heures,
    SUM(CASE WHEN vh.MOTIF_NON_PAIEMENT_ID IS NOT NULL THEN vh.heures ELSE 0 END) heures_non_payables,
    SUM(ep.taux_fc) fc
    --SUM(ep.taux_fc) fc
    SUM(CASE WHEN ep.taux_fc > 0 THEN vh.heures ELSE 0 END) fc
  FROM
         service               s
    JOIN type_volume_horaire tvh ON tvh.code = 'PREVU'
@@ -31,8 +33,7 @@ hetd AS (
  GROUP BY
    intervenant_id
)
SELECT
  i.annee_id                        annee_id,
SELECT i.annee_id                        annee_id,
       i.code                            code_intervenant,
       i.id                              intervenant_id,
       tpj.id                            type_piece_jointe_id,
@@ -40,15 +41,14 @@ SELECT
       MAX(tpjs.obligatoire)             obligatoire,
       MAX(COALESCE(hetd.total_hetd, 0)) heures_pour_seuil_hetd,
       MIN(tpjs.duree_vie)               duree_vie
FROM
            intervenant                 i
FROM intervenant i
         LEFT JOIN intervenant_dossier d ON d.intervenant_id = i.id AND d.histo_destruction IS NULL
       JOIN type_piece_jointe_statut tpjs ON tpjs.statut_id = i.statut_id AND tpjs.histo_destruction IS NULL AND i.annee_id = tpjs.annee_id
         JOIN type_piece_jointe_statut tpjs
              ON tpjs.statut_id = i.statut_id AND tpjs.histo_destruction IS NULL AND i.annee_id = tpjs.annee_id
         JOIN type_piece_jointe tpj ON tpj.id = tpjs.type_piece_jointe_id AND tpj.histo_destruction IS NULL
         LEFT JOIN i_h ON i_h.intervenant_id = i.id
         LEFT JOIN hetd ON hetd.intervenant_id = i.id
WHERE
  i.histo_destruction IS NULL
WHERE i.histo_destruction IS NULL
    /*@INTERVENANT_ID=i.id*/
    /*@ANNEE_ID=i.annee_id*/

@@ -64,16 +64,17 @@ WHERE
  AND CASE
          WHEN tpjs.changement_rib = 0 OR d.id IS NULL
              THEN 1
      ELSE CASE WHEN
          ELSE CASE
                   WHEN
                               replace(i.bic, ' ', '') = replace(d.bic, ' ', '')
                           AND replace(i.iban, ' ', '') = replace(d.iban, ' ', '')
      THEN 0 ELSE 1 END
                       THEN 0
                   ELSE 1 END
          END = 1

  -- Filtre FC
  AND (tpjs.fc = 0 OR i_h.fc > 0)
GROUP BY
  i.annee_id,
GROUP BY i.annee_id,
         i.id,
         i.code,
         tpj.id
 No newline at end of file
+10 −51
Changes for module/Application/src/Controller/PieceJointeController.php: 10 added lines, 51 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ use Application\Entity\Db\TblPieceJointeDemande;
use Application\Entity\Db\TypePieceJointe;
use Application\Entity\Db\TypePieceJointeStatut;
use Application\Entity\Db\Validation;
use Application\Entity\Db\WfEtape;
use Application\Form\PieceJointe\Traits\ModifierTypePieceJointeStatutFormAwareTrait;
use Application\Service\Traits\IntervenantServiceAwareTrait;
use Application\Service\Traits\PieceJointeServiceAwareTrait;
@@ -65,7 +66,6 @@ class PieceJointeController extends AbstractController
    }



    /**
     *
     * @return ViewModel
@@ -99,7 +99,7 @@ class PieceJointeController extends AbstractController

        $annee = $this->getServiceContext()->getAnnee();

        $messages = $this->makeMessages($demandees, $fournies);
        $messages = $this->makeMessages($intervenant);

        $alertContrat = $role->getIntervenant() && $intervenant->getStatut()->getContrat();

@@ -107,7 +107,6 @@ class PieceJointeController extends AbstractController
    }



    /**
     *
     * @return ViewModel
@@ -122,52 +121,29 @@ class PieceJointeController extends AbstractController
        $demandees = $this->getServicePieceJointe()->getTypesPiecesDemandees($intervenant);
        $fournies = $this->getServicePieceJointe()->getPiecesFournies($intervenant);

        $messages = $this->makeMessages($demandees, $fournies);
        $messages = $this->makeMessages($intervenant);

        return compact('messages');
    }



    /**
     * @param TblPieceJointeDemande[] $demandees
     * @param TblPieceJointeFournie[] $fournies
     * @param Intervenant $intervenant
     *
     * @return array
     */
    protected function makeMessages(array $demandees, array $fournies)
    protected function makeMessages(Intervenant $intervenant)
    {
        $role                     = $this->getServiceContext()->getSelectedIdentityRole();
        $isIntervenant            = (boolean)$role->getIntervenant();
        $nbDemandees              = 0;
        $nbFournies               = 0;
        $nbValidees               = 0;
        $nbObligatoiresNonFournis = 0;

        foreach ($demandees as $demandee) {
            if ($demandee->isObligatoire()) {
                $nbDemandees++;
                if (isset($fournies[$demandee->getTypePieceJointe()->getId()])) {
                    $pj = $fournies[$demandee->getTypePieceJointe()->getId()];
                    if (!$pj->getFichier()->isEmpty()) {
                        $nbFournies++;
                        if ($pj->getValidation()) {
                            $nbValidees++;
                        }
                    }
                }
            }
        }

        $workflowEtapePjSaisie = $this->getServiceWorkflow()->getEtape(WfEtape::CODE_PJ_SAISIE, $intervenant);
        $workflowEtapePjValide = $this->getServiceWorkflow()->getEtape(WfEtape::CODE_PJ_VALIDATION, $intervenant);
        $msgs = [];

        if (0 == $nbDemandees) {
            $msgs['info'][] = 'Aucune pièce justificative obligatoire n\'est à fournir';
        } elseif ($nbFournies < $nbDemandees) {
        if ($workflowEtapePjSaisie->getFranchie() != 1) {
            $msgs['danger'][] = "Des pièces justificatives obligatoires n'ont pas été fournies.";
        } elseif ($nbFournies == $nbDemandees && $nbValidees == $nbDemandees) {
        } elseif ($workflowEtapePjSaisie->getFranchie() == 1 && $workflowEtapePjValide->getFranchie() == 1) {
            $msgs['success'][] = "Toutes les pièces justificatives obligatoires ont été fournies et validées.";
        } elseif ($nbFournies == $nbDemandees && $nbValidees < $nbFournies) {
        } elseif ($workflowEtapePjSaisie->getFranchie() == 1 && $workflowEtapePjValide->getFranchie() != 1) {
            $msgs['success'][] = "Toutes les pièces justificatives obligatoires ont été fournies.";
            $msgs['warning'][] = "Mais certaines doivent encore être validées par un gestionnaire.";
        }
@@ -176,7 +152,6 @@ class PieceJointeController extends AbstractController
    }



    public function validationAction()
    {
        $this->initFilters();
@@ -189,7 +164,6 @@ class PieceJointeController extends AbstractController
    }



    public function validerAction()
    {
        $this->initFilters();
@@ -207,7 +181,6 @@ class PieceJointeController extends AbstractController
    }



    public function archiverAction()
    {
        $this->initFilters();
@@ -229,7 +202,6 @@ class PieceJointeController extends AbstractController
    }



    public function devaliderAction()
    {
        $this->initFilters();
@@ -247,7 +219,6 @@ class PieceJointeController extends AbstractController
    }



    public function listerAction()
    {
        $this->initFilters();
@@ -268,7 +239,6 @@ class PieceJointeController extends AbstractController
    }



    public function televerserAction()
    {
        $intervenant = $this->getEvent()->getParam('intervenant');
@@ -292,7 +262,6 @@ class PieceJointeController extends AbstractController
    }



    public function telechargerAction()
    {
        /** @var Fichier $fichier */
@@ -313,7 +282,6 @@ class PieceJointeController extends AbstractController
    }



    public function supprimerAction()
    {
        if (!$this->getRequest()->isPost()) {
@@ -340,7 +308,6 @@ class PieceJointeController extends AbstractController
    }



    /* Actions liées à la configuration des PJ */

    public function configurationAction()
@@ -349,7 +316,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeStatutAction()
    {
        $codeIntervenant = $this->params()->fromRoute('codeTypeIntervenant', TypeIntervenant::CODE_EXTERIEUR);
@@ -412,7 +378,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeDeleteAction()
    {
        $typePieceJointe = $this->getEvent()->getParam('typePieceJointe');
@@ -428,7 +393,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeSaisieAction()
    {
        /* @var $typePieceJointe TypePieceJointe */
@@ -448,7 +412,6 @@ class PieceJointeController extends AbstractController
    }



    public function modifierTypePieceJointeStatutAction()
    {
        /* @var $tpjs TypePieceJointeStatut */
@@ -474,7 +437,6 @@ class PieceJointeController extends AbstractController
    }



    public function typePieceJointeTrierAction()
    {
        /* @var $tpj TypePieceJointe */
@@ -500,7 +462,6 @@ class PieceJointeController extends AbstractController
    }



    public function deleteTypePieceJointeStatutAction()
    {
        $typePieceJointeStatut = $this->getEvent()->getParam('typePieceJointeStatut');
@@ -516,7 +477,6 @@ class PieceJointeController extends AbstractController
    }



    private function updateTableauxBord(Intervenant $intervenant, $validation = false)
    {
        $this->getServiceWorkflow()->calculerTableauxBord([
@@ -537,7 +497,6 @@ class PieceJointeController extends AbstractController
    }



    public function refuserAction()
    {
        /** @var PieceJointe $pj */
+6 −3
Changes for module/Application/src/View/Helper/UserCurrent.php: 6 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ class UserCurrent extends UserAbstract
        /* @var $userStatusHelper \UnicaenAuth\View\Helper\UserStatus */
        $status                = $userStatusHelper(false);
        $userProfileSelectable = true;

        $deconnexion ="";
        if ($this->getIdentity()) {
            if ($userProfileSelectable) {
                // DS : cas où aucun rôle n'est sélectionné, on affiche le rôle "user"
@@ -56,13 +56,16 @@ class UserCurrent extends UserAbstract
            $userProfileHelper->setUserProfileSelectable($userProfileSelectable);

            $content = $userProfileHelper;
            // - Lien de déconnexion.
            /** @var \UnicaenAuth\View\Helper\UserConnection $userConnectionHelper */
            $userConnectionHelper = $this->getView()->plugin('userConnection');
            $deconnexion = "|".$userConnectionHelper->renderDisconnection();
        } else {
            $status = "<span id=\"user-status-icon\" class=\"fa fa-user\"></span> Vous n'êtes pas connecté(e)";
            $content = _("Aucun");
        }

        $content = htmlspecialchars(preg_replace('/\r\n|\n|\r/', '', $content));

        $title = _("Utilisateur connecté à l'application");

        $out = <<<EOS
@@ -73,7 +76,7 @@ class UserCurrent extends UserAbstract
   data-bs-toggle="popover" 
   data-bs-html="true" 
   data-bs-content="$content" 
   href="#">$status<span class="caret"></span></a>
   href="#">$status<span class="caret"><div class="text-center">$deconnexion</div></span></a>
EOS;
        $out .= PHP_EOL;