Commit d4623aab authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files
Pouvoir personnaliser la répartition AA/AC pour le référentiel
parent b0f9fbe8
Loading
Loading
Loading
Loading
+5 −1
Changes for data/parametres.php: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ return [
        "DESCRIPTION" => "Constatation du service fait",
    ],

    /* Paiepment */
    /* Paiement */
    "centres_couts_paye"                         => [
        "VALEUR"      => "enseignement",
        "DESCRIPTION" => "Centres de coûts utilisés pour la paye",
@@ -87,6 +87,10 @@ return [
        "VALEUR"      => "prorata",
        "DESCRIPTION" => "Ventilation des heures AA/AC",
    ],
    "pourc_aa_referentiel" => [
        "VALEUR"      => '0.4',
        "DESCRIPTION" => "Pourcentage AA pour les heures de référentiel",
    ],
    "pourc_s1_pour_annee_civile"                 => [
        "VALEUR"      => "0.67",
        "DESCRIPTION" => "Taux de répartition en année civile pour les heures du premire semestre",
+6
Changes for module/Application/src/Controller/ParametreController.php: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ class ParametreController extends AbstractController
            if (isset($posted['pourc_s1_pour_annee_civile'])) {
                $posted['pourc_s1_pour_annee_civile'] = floatToString(FloatFromString::run($posted['pourc_s1_pour_annee_civile']) / 100);
            }
            if (isset($posted['pourc_aa_referentiel'])) {
                $posted['pourc_aa_referentiel'] = floatToString(FloatFromString::run($posted['pourc_aa_referentiel']) / 100);
            }
            if (isset($posted['taux_conges_payes'])) {
                $posted['taux_conges_payes'] = floatToString(FloatFromString::run($posted['taux_conges_payes']) / 100);
            }
@@ -101,6 +104,9 @@ class ParametreController extends AbstractController
                if ($parametre == 'pourc_s1_pour_annee_civile') {
                    $value = StringFromFloat::run(stringToFloat($value) * 100);
                }
                if ($parametre == 'pourc_aa_referentiel') {
                    $value = StringFromFloat::run(stringToFloat($value) * 100);
                }
                if ($parametre == 'taux_conges_payes') {
                    $value = StringFromFloat::run(stringToFloat($value) * 100);
                }
+15
Changes for module/Application/src/Form/ParametresForm.php: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -239,6 +239,21 @@ class ParametresForm extends AbstractForm
            'type'       => 'Text',
        ]);

        $this->add([
            'name'       => 'pourc_aa_referentiel',
            'options'    => [
                'label'  => 'Pour les heures de référentiel, % d\'heures sur l\'année antérieure',
                'suffix' => '%',
            ],
            'attributes' => [
                'class' => 'input-sm',
                'step'  => 'any',
                'min'   => 0,
                'max'   => 1,
            ],
            'type'       => 'Text',
        ]);

        $this->add([
            'type'       => 'Select',
            'name'       => 'distinction_fi_fa_fc',
+30 −2
Changes for module/Application/view/application/parametre/generaux.phtml: 30 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -243,10 +243,15 @@
                        <?= $this->formControlGroup($form->get('regle_repartition_annee_civile')); ?>
                    </div>
                </div>
                <div class="row">
                <div class="row regle_paiement_annee_civile_details">
                    <div class="col-md-6">
                        <?= $this->formControlGroup($form->get('pourc_s1_pour_annee_civile')); ?>
                    </div>
                    <div class="col-md-6">
                        <?= $this->formControlGroup($form->get('pourc_aa_referentiel')); ?>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <?= $this->formControlGroup($form->get('distinction_fi_fa_fc')); ?>
                    </div>
@@ -338,9 +343,32 @@
                </div>
            </div>
        </div>
    </div>
    <script>

        $(function () {

    </div>
            var reglePaiementAnneeCivile = $('select[name="regle_paiement_annee_civile"]');

            reglePaiementAnneeCivile.on("change", function (e, item) {
                changementReglePaiementAnneeCivile(reglePaiementAnneeCivile);
            });

            changementReglePaiementAnneeCivile(reglePaiementAnneeCivile);
        });

        function changementReglePaiementAnneeCivile(reglePaiementAnneeCivile)
        {
            var val = reglePaiementAnneeCivile.val();

            if ('semestre-date' == val) {
                $('.regle_paiement_annee_civile_details').show();
            } else {
                $('.regle_paiement_annee_civile_details').hide();
            }
        }

    </script>
<?php
if ($canEdit) echo $this->formsubmit($form->get('submit'));
echo $this->form()->closeTag();
+8 −3
Changes for module/Paiement/src/Tbl/Process/PaiementProcess.php: 8 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -53,15 +53,20 @@ class PaiementProcess implements ProcessInterface

    protected function init()
    {
        $regleRLM = $this->getServiceParametres()->get('regle_repartition_annee_civile');
        $parametres = $this->getServiceParametres();

        $regleRLM = $parametres->get('regle_repartition_annee_civile');
        $this->rapprocheur->setRegle($regleRLM);

        $reglePaiementAnneeCiv = $this->getServiceParametres()->get('regle_paiement_annee_civile');
        $reglePaiementAnneeCiv = $parametres->get('regle_paiement_annee_civile');
        $this->repartiteur->setReglePaiementAnneeCiv($reglePaiementAnneeCiv);

        $pourcS1PourAnneeCivile = (float)$this->getServiceParametres()->get('pourc_s1_pour_annee_civile');
        $pourcS1PourAnneeCivile = (float)$parametres->get('pourc_s1_pour_annee_civile');
        $this->repartiteur->setPourcS1PourAnneeCivile($pourcS1PourAnneeCivile);

        $pourcAAReferentiel = (float)$parametres->get('pourc_aa_referentiel');
        $this->repartiteur->setPourAAReferentiel($pourcAAReferentiel);

        $this->services = [];
        $this->tblData = [];
    }
Loading