adaptation versements personnes aux nouvelles structures
FossilOrigin-Name: ceca540fd6ead507a1d322c07a884d0aa1b8a44cf9501f8179ddaee4d12df3fb
This commit is contained in:
parent
7dbbe5bfc1
commit
d7faf06f10
5 changed files with 66 additions and 22 deletions
|
|
@ -74,6 +74,37 @@ class Utils
|
|||
return $db->get($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Versements totaux par personne pour une année donnée
|
||||
* @param année
|
||||
*/
|
||||
public static function getVersementsTotaux($annee)
|
||||
{
|
||||
$sql =
|
||||
"SELECT
|
||||
membres.id as idUser,
|
||||
sum(acc_transactions_lines.credit) AS versement
|
||||
FROM
|
||||
acc_transactions_users,
|
||||
membres,
|
||||
acc_transactions
|
||||
INNER JOIN acc_transactions_lines
|
||||
ON acc_transactions_lines.id_transaction = acc_transactions.id
|
||||
WHERE (
|
||||
strftime('%Y', acc_transactions.date) = ?
|
||||
AND
|
||||
acc_transactions_lines.credit > 0
|
||||
AND
|
||||
acc_transactions_users.id_transaction = acc_transactions.id
|
||||
AND
|
||||
acc_transactions_users.id_user = membres.id
|
||||
)
|
||||
GROUP by acc_transactions_users.id_user
|
||||
ORDER by membres.nom COLLATE U_NOCASE;
|
||||
";
|
||||
return DB::getInstance()->get($sql, $annee);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return personnes ayant versé des dons pour une année donnée
|
||||
* @param $annee
|
||||
|
|
@ -269,7 +300,7 @@ class Utils
|
|||
* Versements totaux par personne pour une année donnée
|
||||
* @param année
|
||||
*/
|
||||
public static function getVersementsTotaux($annee) {
|
||||
public static function getVersementsTotaux_old($annee) {
|
||||
$sql =
|
||||
"SELECT
|
||||
acc_transactions_users.id_user as idUser,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue