Commit 06d1620e authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Gestion de la visibilité & affichage nonPayable & serviceStatutaire

parent dbe670ae
Loading
Loading
Loading
Loading
+35 −12
Changes for front/Formule/Details.vue: 35 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -72,40 +72,44 @@
                </tr>
                <tr class="details">
                    <th rowspan="2">&nbsp;</th>
                    <th colspan="2">Horaire</th>
                    <th colspan="2" v-if="data.visibilite.horaires">Horaire</th>
                    <th rowspan="2">Période</th>
                    <th rowspan="2" v-for="(param,pi) in data.vhParams" :key="pi">{{ param }}</th>
                    <th rowspan="2">Motif non paiement</th>
                    <th rowspan="2" v-if="data.visibilite.motifsNonPaiement">Motif non paiement</th>
                    <th rowspan="2">Type d'intervention</th>
                    <th colspan="2">Majoration</th>
                    <th rowspan="2" v-if="data.visibilite.servicesStatutaire"><abbr title="Détermine si les heures peuvent être comptées dans le service statutaire de l'intervenant ou non">Peut dans serv.</abbr></th>
                    <th colspan="2" v-if="data.visibilite.majorations">Majoration</th>
                    <th rowspan="2">Heures</th>
                    <th rowspan="2">&nbsp;</th>
                    <template v-for="(sousTypesHetd,typeHetd) in data.typesHetd" :key="typeHetd">
                        <th :rowspan="sousTypesHetd.length == 0 ? 2 : 1" :colspan="Math.max(sousTypesHetd.length,1)">{{ typeHetd }}</th>
                        <th :rowspan="sousTypesHetd.length == 0 ? 2 : 1" :colspan="Math.max(sousTypesHetd.length,1)">
                            {{ typeHetd }}
                        </th>
                    </template>
                </tr>
                <tr class="details">
                    <th>Début</th>
                    <th>Fin</th>
                    <th>Service</th>
                    <th>Compl.</th>
                    <th v-if="data.visibilite.horaires">Début</th>
                    <th v-if="data.visibilite.horaires">Fin</th>
                    <th v-if="data.visibilite.majorations">Service</th>
                    <th v-if="data.visibilite.majorations">Compl.</th>
                    <template v-for="typeHetd in data.typesHetd" :key="typeHetd">
                        <th v-for="(sth,k) in typeHetd" :key="k">{{ sth }}</th>
                    </template>
                </tr>
                <tr v-for="(vhdata, vhid) in sdata.volumesHoraires" :key="vhid">
                    <details-volume-horaire-enseignement v-if="sdata.type=='enseignement'" :vh="vhdata"/>
                    <details-volume-horaire-referentiel v-else :vhr="vhdata"/>
                    <details-volume-horaire-enseignement v-if="sdata.type=='enseignement'" :vh="vhdata"
                                                         :visibilite="data.visibilite"/>
                    <details-volume-horaire-referentiel v-else :vhr="vhdata" :visibilite="data.visibilite"/>
                    <details-hetds :hetds="vhdata.hetd"/>
                </tr>
                <tr>
                    <th class="total" colspan="9">Total</th>
                    <th class="total" :colspan="totalColSpan()">Total</th>
                    <th>&nbsp;</th>
                    <details-hetds :hetds="sdata.hetd"/>
                </tr>
            </template>
            <tr>
                <th class="total" colspan="9">Total intervenant</th>
                <th class="total" :colspan="totalColSpan()">Total intervenant</th>
                <th>&nbsp;</th>
                <details-hetds :hetds="data.intervenant.hetd"/>
            </tr>
@@ -175,6 +179,25 @@ export default {
        dataUrl()
        {

        },
        totalColSpan()
        {
            let tcs = 4;

            if (this.data.visibilite.horaires){
                tcs += 2;
            }
            if (this.data.visibilite.motifsNonPaiement){
                tcs += 1;
            }
            if (this.data.visibilite.servicesStatutaire){
                tcs += 1;
            }
            if (this.data.visibilite.majorations){
                tcs += 2;
            }

            return tcs;
        },
        countChoix()
        {
+13 −6
Changes for front/Formule/DetailsVolumeHoraireEnseignement.vue: 13 added lines, 6 removed lines.
Original line number Diff line number Diff line
<template>
    <td style="text-align: center"><abbr :title="histoTooltip()"><i class="fa-regular fa-user"></i></abbr></td>
    <td>{{ vh.horaireDebut }}</td>
    <td>{{ vh.horaireFin }}</td>
    <td v-if="visibilite.horaires">{{ vh.horaireDebut }}</td>
    <td v-if="visibilite.horaires">{{ vh.horaireFin }}</td>
    <td style="text-align: center">{{ vh.periode.libelle }}</td>
    <td v-for="(param,pi) in vh.params" :key="pi">{{ param }}</td>
    <td>{{ motifNonPaiement() }}</td>
    <td v-if="visibilite.motifsNonPaiement">{{ motifNonPaiement() }}</td>
    <td><abbr :title="typeInterventionTooltip()">{{ vh.typeIntervention.code }}</abbr></td>
    <td>{{ floatToString(vh.ponderationServiceDu) }}</td>
    <td>{{ floatToString(vh.ponderationServiceCompl) }}</td>
    <td v-if="visibilite.servicesStatutaire">
        <i v-if="vh.serviceStatutaire" class="fa fa-check text-success"></i>
        <i v-else class="fa fa-xmark text-danger"></i>
    </td>
    <td v-if="visibilite.majorations">{{ floatToString(vh.ponderationServiceDu) }}</td>
    <td v-if="visibilite.majorations">{{ floatToString(vh.ponderationServiceCompl) }}</td>
    <td>
        <u-heures :valeur="vh.heures"></u-heures>
    </td>
@@ -19,7 +23,8 @@ export default {
    name: 'DetailsVolumeHoraireEnseignement',
    components: {},
    props: {
        vh: {type: Object}
        vh: {type: Object},
        visibilite: {type: Object},
    },
    methods: {
        histoTooltip()
@@ -38,6 +43,8 @@ export default {
        {
            if (this.vh.motifNonPaiement) {
                return this.vh.motifNonPaiement.libelle;
            } else if (this.vh.nonPayable) {
                return 'Non payable';
            }else {
                return '';
            }
+15 −8
Changes for front/Formule/DetailsVolumeHoraireReferentiel.vue: 15 added lines, 8 removed lines.
Original line number Diff line number Diff line
<template>
    <td style="text-align: center"><abbr :title="histoTooltip()"><i class="fa-regular fa-user"></i></abbr></td>
    <td></td>
    <td></td>
    <td v-if="visibilite.horaires"></td>
    <td v-if="visibilite.horaires"></td>
    <td></td>
    <td v-for="(param,pi) in vhr.params" :key="pi">{{ param }}</td>
    <td>{{ motifNonPaiement() }}</td>
    <td v-if="visibilite.motifsNonPaiement">{{ motifNonPaiement() }}</td>
    <td>Référentiel</td>
    <td>{{ floatToString(vhr.ponderationServiceDu) }}</td>
    <td>{{ floatToString(vhr.ponderationServiceCompl) }}</td>
    <td v-if="visibilite.servicesStatutaire">
        <i v-if="vh.serviceStatutaire" class="fa fa-check text-success"></i>
        <i v-else class="fa fa-xmark text-danger"></i>
    </td>
    <td v-if="visibilite.majorations">{{ floatToString(vhr.ponderationServiceDu) }}</td>
    <td v-if="visibilite.majorations">{{ floatToString(vhr.ponderationServiceCompl) }}</td>
    <td><u-heures :valeur="vhr.heures"></u-heures></td>
    <td>&nbsp;</td>
</template>
@@ -17,7 +21,8 @@ export default {
    name: 'DetailsVolumeHoraireReferentiel',
    components: {},
    props: {
        vhr: {type: Object}
        vhr: {type: Object},
        visibilite: {type: Object},
    },
    methods: {
        histoTooltip()
@@ -29,8 +34,10 @@ export default {
        },
        motifNonPaiement()
        {
            if (this.vhr.motifNonPaiement) {
                return this.vhr.motifNonPaiement.libelle;
            if (this.vh.motifNonPaiement) {
                return this.vh.motifNonPaiement.libelle;
            } else if (this.vh.nonPayable) {
                return 'Non payable';
            }else {
                return '';
            }
+43 −14
Changes for module/Formule/src/Model/FormuleDetailsExtractor.php: 43 added lines, 14 removed lines.
Original line number Diff line number Diff line
@@ -25,6 +25,12 @@ class FormuleDetailsExtractor implements ExtractionInterface
    private array $typesHetd          = [];
    private array $intervenant        = [];
    private array $services           = [];
    private array $visibilite         = [
        'horaires'          => false,
        'motifsNonPaiement' => false,
        'majorations'       => false,
        'servicesStatutaire' => false,
    ];



@@ -62,6 +68,7 @@ class FormuleDetailsExtractor implements ExtractionInterface
            'typesHetd'          => $this->finaliserTypesHetd($this->typesHetd),
            'intervenant'        => $this->intervenant,
            'services'           => $this->services,
            'visibilite'         => $this->visibilite,
        ];

        return $result;
@@ -308,30 +315,42 @@ class FormuleDetailsExtractor implements ExtractionInterface
        $eIds = [];
        $rIds = [];
        foreach ($this->trace->getSubs() as $sname => $service) {
            foreach ($service->getSubs() as $vh) {
                if ($vh->getVolumeHoraire()->getVolumeHoraire()) {
                    $sId    = 'e' . $vh->getVolumeHoraire()->getService();
                    $vhId   = 'e' . $vh->getVolumeHoraire()->getVolumeHoraire();
                    $eIds[] = $vh->getVolumeHoraire()->getVolumeHoraire();
            foreach ($service->getSubs() as $subVh) {
                $vh = $subVh->getVolumeHoraire();
                if ($vh->getVolumeHoraire()) {
                    $sId    = 'e' . $vh->getService();
                    $vhId   = 'e' . $vh->getVolumeHoraire();
                    $eIds[] = $vh->getVolumeHoraire();
                } else {
                    $sId    = 'r' . $vh->getVolumeHoraire()->getServiceReferentiel();
                    $vhId   = 'r' . $vh->getVolumeHoraire()->getVolumeHoraireReferentiel();
                    $rIds[] = $vh->getVolumeHoraire()->getVolumeHoraireReferentiel();
                    $sId    = 'r' . $vh->getServiceReferentiel();
                    $vhId   = 'r' . $vh->getVolumeHoraireReferentiel();
                    $rIds[] = $vh->getVolumeHoraireReferentiel();
                }
                $this->services[$sId]['volumesHoraires'][$vhId] = [
                    'type'                    => str_starts_with($vhId, 'e') ? 'enseignement' : 'referentiel',
                    'id'                      => substr($vhId, 1),
                    'tauxServiceDu'           => $vh->getVolumeHoraire()->getTauxServiceDu(),
                    'tauxServiceCompl'        => $vh->getVolumeHoraire()->getTauxServiceCompl(),
                    'ponderationServiceDu'    => $vh->getVolumeHoraire()->getPonderationServiceDu(),
                    'ponderationServiceCompl' => $vh->getVolumeHoraire()->getPonderationServiceCompl(),
                    'tauxServiceDu'           => $vh->getTauxServiceDu(),
                    'tauxServiceCompl'        => $vh->getTauxServiceCompl(),
                    'ponderationServiceDu'    => $vh->getPonderationServiceDu(),
                    'ponderationServiceCompl' => $vh->getPonderationServiceCompl(),
                    'nonPayable'              => $vh->isNonPayable(),
                    'serviceStatutaire'       => $vh->isServiceStatutaire(),
                    'params'                  => [],
                ];
                if (!$this->visibilite['majorations'] && ($vh->getPonderationServiceDu() != 1.0 && $vh->getPonderationServiceCompl() != 1.0)) {
                    $this->visibilite['majorations'] = true;
                }
                if (!$this->visibilite['motifsNonPaiement'] && $vh->isNonPayable()){
                    $this->visibilite['motifsNonPaiement'] = true;
                }
                if (!$this->visibilite['servicesStatutaire'] && !$vh->isServiceStatutaire()){
                    $this->visibilite['servicesStatutaire'] = true;
                }
                foreach ($this->vhParams as $i => $null) {
                    $this->services[$sId]['volumesHoraires'][$vhId]['params'][$i] = $vh->getVolumeHoraire()->{"getParam$i"}();
                    $this->services[$sId]['volumesHoraires'][$vhId]['params'][$i] = $vh->{"getParam$i"}();
                }
                foreach ($this->typesHetd as $typeHetd) {
                    $valeur                                                            = $vh->getValeur($typeHetd);
                    $valeur                                                            = $subVh->getValeur($typeHetd);
                    $this->services[$sId]['volumesHoraires'][$vhId]['hetd'][$typeHetd] = $this->valeurToJson($valeur);
                }
            }
@@ -403,6 +422,13 @@ class FormuleDetailsExtractor implements ExtractionInterface
                        ],
                    ],
                ];

                if (($sdata['horaireDebut'] || $sdata['horaireFin']) && !$this->visibilite['horaires']) {
                    $this->visibilite['horaires'] = true;
                }
                if ($sdata['motifNonPaiement'] && !$this->visibilite['motifsNonPaiement']) {
                    $this->visibilite['motifsNonPaiement'] = true;
                }
                $vhId                                           = 'e' . $data['ID'];
                $sId                                            = 'e' . $data['SERVICE_ID'];
                $this->services[$sId]['volumesHoraires'][$vhId] = array_merge($this->services[$sId]['volumesHoraires'][$vhId], $sdata);
@@ -454,6 +480,9 @@ class FormuleDetailsExtractor implements ExtractionInterface
                        ],
                    ],
                ];
                if ($sdata['motifNonPaiement'] && !$this->visibilite['motifsNonPaiement']) {
                    $this->visibilite['motifsNonPaiement'] = true;
                }
                $vhId                                           = 'r' . $data['ID'];
                $sId                                            = 'r' . $data['SERVICE_REFERENTIEL_ID'];
                $this->services[$sId]['volumesHoraires'][$vhId] = array_merge($this->services[$sId]['volumesHoraires'][$vhId], $sdata);