2022-01-29 15:03:41 +01:00
|
|
|
<?php
|
|
|
|
|
2023-09-28 13:20:36 +02:00
|
|
|
namespace Paheko;
|
2022-01-29 15:03:41 +01:00
|
|
|
|
2023-09-28 13:20:36 +02:00
|
|
|
use Paheko\Plugin\RecusFiscaux\Personne;
|
|
|
|
use Paheko\Plugin\RecusFiscaux\Utils;
|
2022-01-29 15:03:41 +01:00
|
|
|
|
2022-05-18 12:29:19 +02:00
|
|
|
// vérifier si le taux de réduction a été sélectionné au préalable
|
2023-02-04 16:32:03 +01:00
|
|
|
$taux = f('taux_reduction');
|
|
|
|
if (! isset($_SESSION['taux_reduction'])
|
|
|
|
&&
|
|
|
|
null === $taux)
|
2022-05-20 21:42:57 +02:00
|
|
|
{
|
2023-09-28 13:20:36 +02:00
|
|
|
\Paheko\Utils::redirect(PLUGIN_URL . 'index.php');
|
2022-04-24 14:07:36 +02:00
|
|
|
}
|
2023-02-04 16:32:03 +01:00
|
|
|
if (null !== $taux) {
|
|
|
|
$_SESSION['taux_reduction'] = $taux;
|
|
|
|
}
|
2022-04-24 14:07:36 +02:00
|
|
|
|
2022-05-18 12:29:19 +02:00
|
|
|
// versements par personne
|
|
|
|
$_SESSION['lesVersements'] = Utils::getVersementsPersonnes(
|
|
|
|
$_SESSION['annee_recu'],
|
|
|
|
'like',
|
|
|
|
'7%',
|
|
|
|
$champsNom);
|
2022-01-29 15:03:41 +01:00
|
|
|
|
|
|
|
// préparation de l'affichage
|
2022-03-24 19:00:39 +01:00
|
|
|
$tpl->assign('lesVersements', $_SESSION['lesVersements']);
|
2023-02-04 16:32:03 +01:00
|
|
|
$tpl->assign('annee_recu', $_SESSION['annee_recu']);
|
2022-01-29 15:03:41 +01:00
|
|
|
$tpl->assign('plugin_css', ['style.css']);
|
|
|
|
|
|
|
|
// envoyer au template
|
2022-05-18 12:29:19 +02:00
|
|
|
$tpl->assign('plugin_config', $plugin->getConfig());
|
2022-01-29 15:03:41 +01:00
|
|
|
$tpl->display(PLUGIN_ROOT . '/templates/versements_personnes.tpl');
|