Changement gestion choix année fiscale
FossilOrigin-Name: d6a1c29317cfa870514efff87598a508738ef9d089e52c9b75b0e3e5477a73c9
This commit is contained in:
parent
7d2707eddd
commit
7ca41ea6b7
5 changed files with 90 additions and 23 deletions
|
|
@ -8,12 +8,6 @@ use Garradin\Plugin\RecusFiscaux\Utils;
|
|||
// opérations communes
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// vérifier si l'année a bien été sélectionnée au préalable
|
||||
$_SESSION['annee_recu'] = f('annee_recu');
|
||||
if (! isset($_SESSION['annee_recu']) || $_SESSION['annee_recu'] == "") {
|
||||
\Garradin\Utils::redirect(PLUGIN_URL . 'index.php');
|
||||
}
|
||||
|
||||
// champs pour le nom et prénom
|
||||
$confNoms = Utils::getChampsNom($config, $plugin);
|
||||
uasort($confNoms, function ($a, $b)
|
||||
|
|
@ -30,6 +24,37 @@ foreach ($confNoms as $nom => $champ)
|
|||
$_SESSION['membresDonateurs'] = Utils::getDonateurs($_SESSION['annee_recu'],
|
||||
$champsNom);
|
||||
|
||||
// comparaison de lignes de versements
|
||||
// comparer 2 lignes selon le nom
|
||||
function comparerNoms($ligne1, $ligne2)
|
||||
{
|
||||
return
|
||||
$_SESSION['membresDonateurs'][$ligne1->idUser]->rang
|
||||
-
|
||||
$_SESSION['membresDonateurs'][$ligne2->idUser]->rang;
|
||||
}
|
||||
|
||||
// comparer 2 activités par leur libellé
|
||||
function comparerActivites($ligne1, $ligne2)
|
||||
{
|
||||
return strcoll(
|
||||
$_SESSION['lesActivites'][$_SESSION['lesTarifs'][$ligne1->idTarif]->idActivite]->label,
|
||||
$_SESSION['lesActivites'][$_SESSION['lesTarifs'][$ligne2->idTarif]->idActivite]->label);
|
||||
}
|
||||
|
||||
// comparer 2 lignes selon la date
|
||||
function comparerDate($ligne1, $ligne2)
|
||||
{
|
||||
return
|
||||
strtotime($ligne1->date) - strtotime($ligne2->date);
|
||||
}
|
||||
|
||||
// comparer 2 lignes selon un champ numérique entier
|
||||
function comparerChamp($ligne1, $ligne2, $champ)
|
||||
{
|
||||
return $ligne1->$champ - $ligne2->$champ;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// fonctions pour l'affichage
|
||||
// ------------------------------------------------------------------------
|
||||
|
|
@ -123,6 +148,9 @@ $tpl->register_function('afficher_versement', function ($params)
|
|||
$out .= sprintf('
|
||||
<span>%s</span>',
|
||||
date_format(date_create($versement->date),"d/m/Y"));
|
||||
$out .= sprintf('
|
||||
<span>%s</span>',
|
||||
$versement->compte);
|
||||
$out .= sprintf('
|
||||
</label>
|
||||
</div>'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue