Commit 9d36495a authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Gestion du type d'heures "enseignement"

parent 4786f73d
Loading
Loading
Loading
Loading
+4
Changes for module/Application/src/Entity/Db/FormuleResultatTypesHeuresTrait.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -114,6 +114,8 @@ trait FormuleResultatTypesHeuresTrait
                return $this->getHeuresServiceFa();
            case TypeHeures::FC:
                return $this->getHeuresServiceFc();
            case TypeHeures::ENSEIGNEMENT:
                return $this->getHeuresServiceFi() + $this->getHeuresServiceFa() + $this->getHeuresServiceFc();
            case TypeHeures::REFERENTIEL:
                return $this->getHeuresServiceReferentiel();
            case TypeHeures::MISSION:
@@ -135,6 +137,8 @@ trait FormuleResultatTypesHeuresTrait
                return $this->getHeuresComplFc();
            case TypeHeures::FC_MAJOREES:
                return $this->getHeuresComplFcMajorees();
            case TypeHeures::ENSEIGNEMENT:
                return $this->getHeuresComplFi() + $this->getHeuresComplFa() + $this->getHeuresComplFc() + $this->getHeuresComplFcMajorees();
            case TypeHeures::REFERENTIEL:
                return $this->getHeuresComplReferentiel();
            case TypeHeures::MISSION:
+2
Changes for module/OffreFormation/src/Entity/Db/TypeHeures.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace OffreFormation\Entity\Db;

use Application\Entity\Db\type;
use UnicaenApp\Entity\HistoriqueAwareInterface;
use UnicaenApp\Entity\HistoriqueAwareTrait;
@@ -18,6 +19,7 @@ class TypeHeures implements HistoriqueAwareInterface
    const FC_MAJOREES  = 'fc_majorees';
    const REFERENTIEL  = 'referentiel';
    const MISSION      = 'mission';
    const ENSEIGNEMENT = 'enseignement';

    /**
     * @var string
+10 −1
Changes for module/OffreFormation/src/Service/TypeHeuresService.php: 10 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@ namespace OffreFormation\Service;

use Application\Service\AbstractEntityService;
use Application\Service\RuntimeException;
use Application\Service\Traits\ParametresServiceAwareTrait;
use Doctrine\ORM\QueryBuilder;
use Mission\Entity\Db\Mission;
use OffreFormation\Entity\Db\TypeHeures;
use Paiement\Entity\Db\ServiceAPayerInterface;

@@ -16,6 +16,7 @@ use Paiement\Entity\Db\ServiceAPayerInterface;
 */
class TypeHeuresService extends AbstractEntityService
{
    use ParametresServiceAwareTrait;

    /**
     * retourne la classe des entités
@@ -70,10 +71,18 @@ class TypeHeuresService extends AbstractEntityService
            $codes[$th->getCode()] = $th->getCode();
        }

        if ($this->getServiceParametres()->get('distinction_fi_fa_fc') == '1'){
            if ($serviceAPayer->getHeuresComplFi() != 0) $codes[TypeHeures::FI] = TypeHeures::FI;
            if ($serviceAPayer->getHeuresComplFa() != 0) $codes[TypeHeures::FA] = TypeHeures::FA;
            if ($serviceAPayer->getHeuresComplFc() != 0) $codes[TypeHeures::FC] = TypeHeures::FC;
            if ($serviceAPayer->getHeuresComplFcMajorees() != 0) $codes[TypeHeures::FC_MAJOREES] = TypeHeures::FC_MAJOREES;
        }else{
            $hc = $serviceAPayer->getHeuresComplFi()
                + $serviceAPayer->getHeuresComplFa()
                + $serviceAPayer->getHeuresComplFc()
                + $serviceAPayer->getHeuresComplFcMajorees();
            if ($hc != 0) $codes[TypeHeures::FI] = TypeHeures::ENSEIGNEMENT;
        }
        if ($serviceAPayer->getHeuresComplReferentiel() != 0) $codes[TypeHeures::REFERENTIEL] = TypeHeures::REFERENTIEL;
        if ($serviceAPayer->getHeuresMission() != 0) $codes[TypeHeures::MISSION] = TypeHeures::MISSION;
        $this->finderByCode($codes, $qb, $alias);
+2
Changes for module/Paiement/src/Entity/Db/CcActivite.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -322,6 +322,8 @@ class CcActivite implements HistoriqueAwareInterface
                return $this->getFc();
            case TypeHeures::FC_MAJOREES:
                return $this->getFcMajorees();
            case TypeHeures::ENSEIGNEMENT:
                return $this->getFi() || $this->getFa() || $this->getFc() || $this->getFcMajorees();
            case TypeHeures::REFERENTIEL:
                return $this->getReferentiel();
            case TypeHeures::MISSION:
+2
Changes for module/Paiement/src/Entity/Db/TypeRessource.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -345,6 +345,8 @@ class TypeRessource implements HistoriqueAwareInterface, ResourceInterface
                return $this->getFc();
            case TypeHeures::FC_MAJOREES:
                return $this->getFcMajorees();
            case TypeHeures::ENSEIGNEMENT:
                return $this->getFi() + $this->getFa() + $this->getFc() + $this->getFcMajorees();
            case TypeHeures::REFERENTIEL:
                return $this->getReferentiel();
            case TypeHeures::MISSION: