2022-01-26 12:12:42 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Garradin;
|
|
|
|
|
2022-01-27 09:10:00 +01:00
|
|
|
use Garradin\Plugin\RecusFiscaux\Utils;
|
2022-01-26 12:12:42 +01:00
|
|
|
|
2022-02-07 14:32:17 +01:00
|
|
|
// récupérer les infos du formulaire
|
2022-01-29 15:03:41 +01:00
|
|
|
$lesTarifs = f('tarifs');
|
2022-02-07 14:32:17 +01:00
|
|
|
$_SESSION['annee_recu'] = f('annee_recu');
|
|
|
|
|
|
|
|
// taux de réduction associés
|
|
|
|
$lesTaux = array();
|
|
|
|
foreach ($lesTarifs as $idTarif) {
|
|
|
|
$nomRadio = "taux_reduction_" . $idTarif;
|
|
|
|
$valRadio = f("$nomRadio");
|
|
|
|
$lesTaux[] = $valRadio ? $valRadio: $plugin->getConfig()->reduction[0]->taux;
|
|
|
|
}
|
|
|
|
// error_log("Tarifs = " . print_r($lesTarifs, true) . "\n");
|
|
|
|
// error_log("Réducs = " . print_r($lesTaux, true) . "\n");
|
|
|
|
|
2022-01-29 15:03:41 +01:00
|
|
|
// liste des versements correspondants
|
|
|
|
$_SESSION['lesVersements'] = Utils::getVersementsActivite($_SESSION['annee_recu'], $lesTarifs);
|
2022-01-26 12:12:42 +01:00
|
|
|
|
|
|
|
// liste des activités
|
2022-01-27 09:10:00 +01:00
|
|
|
$activites = Utils::getActivites();
|
2022-01-26 12:12:42 +01:00
|
|
|
foreach ($activites as $num => $activite)
|
|
|
|
{
|
|
|
|
// ajouter les tarifs de l'activité
|
2022-01-28 15:40:21 +01:00
|
|
|
$activite->{'tarifs'} = Utils::getTarifs($activite->{'idActivite'});
|
2022-01-26 12:12:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// préparation de l'affichage
|
|
|
|
$tpl->assign('lesVersements', $_SESSION['lesVersements']);
|
|
|
|
$tpl->assign('listeParActiviteEtTarif', $activites);
|
|
|
|
$tpl->assign('plugin_css', ['style.css']);
|
|
|
|
|
|
|
|
// envoyer au template
|
2022-01-29 15:03:41 +01:00
|
|
|
$tpl->display(PLUGIN_ROOT . '/templates/versements_activites.tpl');
|