Commit 1656051f authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge branch 'b19' of https://git.unicaen.fr/open-source/OSE into b19

parents 1ffd4c40 81e2b7ca
Loading
Loading
Loading
Loading
+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;


+0 −2
Changes for data/ddl/package/OSE_WORKFLOW/body.sql: 0 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -688,7 +688,6 @@ CREATE OR REPLACE PACKAGE BODY OSE_WORKFLOW AS
              ELSE edite
            END                            realisation,
            p2.valeur                      avenant_mode,
            CASE WHEN p2.valeur = ''avenant_desactive'' THEN rownum ELSE 1 END to_delete
          FROM
            tbl_contrat c
            JOIN parametre p on p.nom = ''contrat_regle_franchissement''
@@ -698,7 +697,6 @@ CREATE OR REPLACE PACKAGE BODY OSE_WORKFLOW AS
            AND actif = 1
            AND nbvh > 0
        ) c
        WHERE to_delete = 1
    ';


+0 −1
Changes for data/ddl/view/V_INTERVENANT_HISTORIQUE.sql: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -278,7 +278,6 @@ SELECT C.intervenant_id intervenant_id,
       5                                               ordre
FROM fichier f
         JOIN contrat_fichier cf ON cf.fichier_id = f.id AND histo_destruction IS NULL
         JOIN fichier f ON f.id = cf.fichier_id AND f.histo_destruction IS NULL
         JOIN contrat C ON C.id = cf.contrat_id
         JOIN type_contrat tc ON tc.id = C.type_contrat_id
         JOIN STRUCTURE s ON s.id = C.structure_id
+4 −2
Changes for data/ddl/view/V_TBL_PIECE_JOINTE_DEMANDE.sql: 4 added lines, 2 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'
+10 −31
Changes for module/Application/src/Controller/PieceJointeController.php: 10 added lines, 31 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;
@@ -97,7 +98,7 @@ class PieceJointeController extends AbstractController

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

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

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

@@ -119,51 +120,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.";
        }
Loading