ajout bouton générer
FossilOrigin-Name: c4ee1e2f9ebe9c1a99adb825034569a4274d92e953df1a30475210c08bc3aa28
This commit is contained in:
parent
78f6a982a4
commit
bbfba688c6
5 changed files with 187 additions and 61 deletions
|
|
@ -8,8 +8,74 @@ use Garradin\Plugin\RecusFiscaux\Utils;
|
|||
$_SESSION['taux_reduction'] = $_POST['taux_reduction'];
|
||||
|
||||
// versements par personne
|
||||
$_SESSION['lesVersements'] = Utils::getVersementsPersonnes($_SESSION['annee_recu'],
|
||||
$champsNom);
|
||||
$_SESSION['lesVersements'] = Utils::getVersementsComptes($_SESSION['annee_recu'],
|
||||
"like",
|
||||
'7%',
|
||||
$champsNom);
|
||||
|
||||
// Utils::getVersementsPersonnes($_SESSION['annee_recu'],
|
||||
// $champsNom);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// tests
|
||||
// ------------------------------------------------------------------------
|
||||
/*
|
||||
$versementsComptes = Utils::getVersementsComptes("2021",
|
||||
// "in",
|
||||
// ['706', '7780', '756'],
|
||||
"like",
|
||||
'7%',
|
||||
$champsNom);
|
||||
// table triée par nom, date
|
||||
// error_log("versementsComptes triée par nom, date = " . print_r($versementsComptes, true));
|
||||
|
||||
// comparer 2 lignes selon le nom
|
||||
function comparerNoms($ligne1, $ligne2)
|
||||
{
|
||||
return
|
||||
$_SESSION['membresDonateurs'][$ligne1->idUser]->rang
|
||||
-
|
||||
$_SESSION['membresDonateurs'][$ligne2->idUser]->rang;
|
||||
}
|
||||
|
||||
// comparer 2 lignes selon la date
|
||||
function comparerDate($ligne1, $ligne2)
|
||||
{
|
||||
return
|
||||
strtotime($ligne1->date) - strtotime($ligne2->date);
|
||||
}
|
||||
|
||||
// comparer 2 lignes selon un champ
|
||||
function comparerChamp($ligne1, $ligne2, $champ)
|
||||
{
|
||||
return $ligne1->$champ - $ligne2->$champ;
|
||||
}
|
||||
|
||||
// autres tris
|
||||
// par tarif, nom, date
|
||||
usort($versementsComptes, function($ligne1, $ligne2)
|
||||
{
|
||||
$result = comparerChamp($ligne1, $ligne2, 'idTarif'); //$ligne1->idTarif - $ligne2->idTarif;
|
||||
if ($result == 0) { $result = comparerNoms($ligne1, $ligne2); }
|
||||
if ($result == 0) { $result = comparerDate($ligne1, $ligne2); }
|
||||
return $result;
|
||||
});
|
||||
// error_log("versementsComptes triée par tarif, nom, date = " . print_r($versementsComptes, true));
|
||||
|
||||
// par nom, compte, date...
|
||||
usort($versementsComptes, function($ligne1, $ligne2)
|
||||
{
|
||||
$result = comparerNoms($ligne1, $ligne2);
|
||||
if ($result == 0) { $result = comparerChamp($ligne1, $ligne2, 'compte'); }
|
||||
if ($result == 0) { $result = comparerDate($ligne1, $ligne2); }
|
||||
return $result;
|
||||
});
|
||||
|
||||
// error_log("versementsComptes triée par nom, compte, date = " . print_r($versementsComptes, true));
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
// fin tests
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// préparation de l'affichage
|
||||
$tpl->assign('lesVersements', $_SESSION['lesVersements']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue