Commit eeb521c0 authored by Florian Joriot's avatar Florian Joriot
Browse files

Merge branch 'master' into FJ_LL_Tbl_Contrat

parents 31fbbbe0 994e91aa
Loading
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -26,6 +26,19 @@



# OSE 24.4 (à venir)

## Améliorations

* Possibilité de lancer la commande [calcul-tableaux-bord](doc/ligne-de-commande.md) en précisant un tableau de bord en particulier à actualiser et une année ou un intervenant précis

## Corrections

* Traducteur de formules de calcul : résolution de problème au niveau des SI embarqués dans des paramètres de fonctions (#50652) 
* Correction des demandes de mise en paiement pour pouvoir gérer la notion de budget sur des types de ressources autres que de la "paie état" ou des "ressources propres" (#61953)



# OSE 24.3 (22/05/2025)

## Améliorations
+116 KiB (443 KiB)

File changed.

No diff preview for this file type.

−4.1 KiB (196 KiB)

File changed.

No diff preview for this file type.

+20 −0
Original line number Diff line number Diff line
@@ -32,6 +32,26 @@ Pas de paramètre pour cette commande.
Pas de paramètre pour cette commande.
Attention : le temps de traitement peut être long!

Paramètres supplémentaires :

Vous pouvez lancer la commande pour un tableau de bord en particuler :

```
./bin/ose calcul-tableaux-bord workflow
```

Et également, pour un tableau de bord donné, recalculer pour un intervenant donné (ID à fournir) :

```
./bin/ose calcul-tableaux-bord workflow --intervenant=517
```

Ou même pour une année donnée :

```
./bin/ose calcul-tableaux-bord workflow --annee=2024
```

### ```calcul-feuille-de-route <id>``` : Recalcule la feuille de route de l'intervenant dont l'ID est <id>

<id> doit être un nombre entier correspondant à l'ID d'un intervenant.
+52 −104
Original line number Diff line number Diff line
@@ -14,61 +14,44 @@
        <div :id="'dmep-collapse-' + datas.code" :aria-labelledby="'dmep-heading-' + datas.code"
             class="accordion-collapse collapse show">
            <div class="accordion-body">
                <div v-if="this.dotationPaieEtat + dotationRessourcesPropres > 0">
                <div v-if="this.datas.budget.dotation.total > 0">
                    <!--Budget-->
                    <div class="cartridge gray bordered" style="padding-bottom: 5px;margin-bottom:20px;">
                        <span>Budget</span>
                    </div>
                    <div class="container">
                        <table class="table table-bordered caption-top">
                        <table class="table table-bordered caption-top" style="table-layout: fixed;width:100%">
                            <thead class="table-light">
                            <tr>
                                <th class="fw-bold" scope="col">Paie état</th>
                                <th class="fw-bold" scope="col">Ressources propres</th>

                                <th v-for="(value, index) in datasBudget"
                                    :key="index"
                                    class="fw-bold"
                                    scope="col">{{ value.libelle }}
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>

                                <td style="width:50%;">
                                    <div v-if="this.dotationPaieEtat > 0"
                                <td v-for="(value, index) in datasBudget">
                                    <div v-if="value.dotation > 0"
                                         class="text-center progress position-relative bg-secondary"
                                         style="height: 30px;">
                                        <span class="position-absolute top-50 start-50 translate-middle"
                                              style="color:white;">{{
                                                this.consommationPaieEtat + ' sur ' + this.dotationPaieEtat
                                                value.consommation + ' sur ' + value.dotation
                                            }} HETD</span>
                                        <div :aria-valuemax="this.dotationPaieEtat"
                                             :aria-valuenow="this.consommationPaieEtat"
                                             :class="'progress-bar progress-bar-striped '+ this.bgPaieEtat"
                                             :style="'width:' + this.pourcentagePaieEtat + '%;'"
                                             :title="this.pourcentagePaieEtat + '%'"
                                        <div :aria-valuemax="value.dotation"
                                             :aria-valuenow="value.consommation"
                                             :class="'progress-bar progress-bar-striped '+ bgBudget(value)"
                                             :style="'width:' + pourcentageBudget(value) + '%;'"
                                             :title="this.pourcentageBudget(value) + '%'"
                                             aria-valuemin="0"
                                             role="progressbar">
                                        </div>
                                    </div>
                                    <div v-if="this.dotationPaieEtat == 0" class="text-center">
                                        Aucune dotation paie état
                                    </div>
                                </td>
                                <td style="width:50%;">
                                    <div v-if="this.dotationRessourcesPropres > 0"
                                         class="progress position-relative bg-secondary" style="height: 30px;">
                                        <span class="position-absolute top-50 start-50 translate-middle"
                                              style="color:white;">{{
                                                this.consommationRessourcesPropres + ' sur ' + this.dotationRessourcesPropres
                                            }} HETD</span>
                                        <div :aria-valuemax="this.dotationRessourcesPropres"
                                             :aria-valuenow="this.consommationRessourcesPropres"
                                             :class="'progress-bar progress-bar-striped '+ this.bgRessourcesPropres"
                                             :style="'width:' + this.pourcentageRessourcePropre + '%;'"
                                             :title="this.pourcentageRessourcePropre + '%'"
                                             aria-valuemin="0"
                                             role="progressbar">
                                        </div>
                                    </div>
                                    <div v-if="this.dotationRessourcesPropres == 0" class="text-center">
                                        Aucune dotation ressources propres
                                    <div v-if="value.dotation == 0" class="text-center">
                                        Aucune dotation {{ value.libelle }}
                                    </div>
                                </td>
                            </tr>
@@ -159,8 +142,6 @@
                                                                        <option
                                                                            v-for="item in group.child"
                                                                            :key="item.value"
                                                                            :data-paie-etat="item.paieEtat"
                                                                            :data-ressources-propres="item.ressourcesPropres"
                                                                            :selected="item.centreCoutId==value.centreCout.centreCoutId"
                                                                            :value="item.centreCoutId">
                                                                            {{
@@ -303,8 +284,6 @@
                                                                :label="group.group">
                                                                <option v-for="item in group.child"
                                                                        :key="item.value"
                                                                        :data-paie-etat="item.paieEtat"
                                                                        :data-ressources-propres="item.ressourcesPropres"
                                                                        :selected="item.centreCoutId == value.centreCout.centreCoutId"
                                                                        :value="item.centreCoutId">
                                                                    {{
@@ -463,8 +442,6 @@
                                                                :label="group.group">
                                                                <option v-for="item in group.child"
                                                                        :key="item.value"
                                                                        :data-paie-etat="item.paieEtat"
                                                                        :data-ressources-propres="item.ressourcesPropres"
                                                                        :selected="item.centreCoutId == value.centreCout.centreCoutId"
                                                                        :value="item.centreCoutId"
                                                                >
@@ -570,59 +547,39 @@

export default {


    name: "DemandeMiseEnPaiementStructure",
    props: {
        datas: {required: true},
        intervenant: {required: true},
    },
    data()
    {

        return {
            dotationPaieEtat: this.datas.budget.dotation.paieEtat,
            dotationRessourcesPropres: this.datas.budget.dotation.ressourcePropre,
            consommationPaieEtat: this.datas.budget.liquidation.paieEtat,
            consommationRessourcesPropres: this.datas.budget.liquidation.ressourcePropre,

        }
    },
    watch: {
        datas: function () {
            this.dotationPaieEtat = this.datas.budget.dotation.paieEtat;
            this.dotationRessourcesPropres = this.datas.budget.dotation.ressourcePropre;
            this.consommationPaieEtat = this.datas.budget.liquidation.paieEtat;
            this.consommationRessourcesPropres = this.datas.budget.liquidation.ressourcePropre;
        },

    },
    computed:
        {
            pourcentagePaieEtat()
            {
                return Math.round((this.consommationPaieEtat / this.dotationPaieEtat) * 100);
            },
            pourcentageRessourcePropre()
            {
                return Math.round((this.consommationRessourcesPropres / this.dotationRessourcesPropres) * 100);
            },
            bgPaieEtat()
            datasBudget()
            {
                if (Math.round((this.consommationPaieEtat / this.dotationPaieEtat) * 100) > 100) {
                    return 'bg-warning';
                } else {
                    return 'bg-success';
                let datasBudget = {};
                Object.entries(this.datas.budget.dotation).forEach(([key, value]) => {
                    if (key != 'total') {
                        datasBudget[key] = {};
                        datasBudget[key]['libelle'] = value.libelle;
                        datasBudget[key]['dotation'] = value.heures;
                        datasBudget[key]['consommation'] = 1001;
                    }
            },
            bgRessourcesPropres()
            {
                if (Math.round((this.consommationRessourcesPropres / this.dotationRessourcesPropres) * 100) > 100) {
                    return 'bg-warning';
                } else {
                    return 'bg-success';
                });

                Object.entries(this.datas.budget.consommation).forEach(([key, value]) => {
                    if (key != 'total') {
                        if (key in datasBudget) {
                            datasBudget[key]['consommation'] = value.heures;
                        }

                    }
                });
                return datasBudget;
            }

        },

    methods: {
        heuresStatutToString(value)
        {
@@ -707,8 +664,6 @@ export default {
            let missionId = (inputHeure.hasAttribute('data-mission-id') ? inputHeure.getAttribute('data-mission-id') : '');

            let centreCoutId = inputCentreCout.value;
            let ressourcesPropres = inputCentreCout.options[inputCentreCout.selectedIndex].getAttribute('data-ressources-propres');
            let paieEtat = inputCentreCout.options[inputCentreCout.selectedIndex].getAttribute('data-paie-etat');
            //Si centre de cout non sélectionné
            if (centreCoutId == '') {
                unicaenVue.flashMessenger.toast("Vous devez sélectionner un centre de coût pour demander la mise en paiement de ces heures", 'error', options)
@@ -721,25 +676,6 @@ export default {
                this.$emit('refresh-btn-state');;
                return false;
            }
            //Si je suis sur une demande de mise en paiement avec des fonds paie etat
            if (paieEtat == 1 && this.dotationPaieEtat > 0) {
                let solde = this.dotationPaieEtat - (this.consommationPaieEtat + heureADemander);
                if (solde <= 0) {
                    unicaenVue.flashMessenger.toast("Demande de mise en paiement impossible manque de dotation 'paie etat' pour ces heures", 'error', options)
                    this.$emit('refresh-btn-state');
                    return false;
                }
            }
            //Si je suis sur une demande de mise en paiement avec des fonds ressources propres
            if (ressourcesPropres == 1 && this.dotationRessourcesPropres > 0) {
                let solde = this.dotationRessourcesPropres - (this.consommationRessourcesPropres + heureADemander);
                if (solde <= 0) {
                    unicaenVue.flashMessenger.toast("Demande de mise en paiement impossible manque de dotation 'ressources propres' pour ces heures", 'error', options)
                    this.$emit('refresh-btn-state');
                    return false;
                }
            }


            var datas = [];
            let demande = {
@@ -893,6 +829,18 @@ export default {
        {
            return Util.dateToString(val);

        },
        pourcentageBudget(value)
        {
            return Math.round((value.consommation / value.dotation) * 100);
        },
        bgBudget(value)
        {
            if (Math.round((value.consommation / value.dotation) * 100) > 100) {
                return 'bg-danger';
            } else {
                return 'bg-success';
            }
        }


Loading