From 7b426d3e321f4f53cdc0068a64b03cd80f59fce4 Mon Sep 17 00:00:00 2001 From: engel <> Date: Sat, 29 Jan 2022 14:03:41 +0000 Subject: [PATCH] =?UTF-8?q?ajout=20fonctionnalit=C3=A9s=20choix=20versemen?= =?UTF-8?q?ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FossilOrigin-Name: 62fb6243e8d4dfb25f2b856342249e827a261366be106680411204b5b58977f2 --- lib/Utils.php | 39 +++-- templates/_nav.tpl | 4 +- templates/index.tpl | 41 ++++-- ...ersements.tpl => versements_activites.tpl} | 2 +- ...{personne.tpl => versements_personnes.tpl} | 10 +- www/admin/action.php | 136 +----------------- www/admin/generer_activites.php | 129 +++++++++++++++++ www/admin/index.php | 3 + www/admin/personne.php | 15 -- www/admin/script.js | 26 ++++ ...ersements.php => versements_activites.php} | 9 +- www/admin/versements_personnes.php | 16 +++ 12 files changed, 243 insertions(+), 187 deletions(-) rename templates/{versements.tpl => versements_activites.tpl} (98%) rename templates/{personne.tpl => versements_personnes.tpl} (83%) create mode 100644 www/admin/generer_activites.php delete mode 100644 www/admin/personne.php rename www/admin/{versements.php => versements_activites.php} (60%) create mode 100644 www/admin/versements_personnes.php diff --git a/lib/Utils.php b/lib/Utils.php index 22cf619..126776d 100644 --- a/lib/Utils.php +++ b/lib/Utils.php @@ -96,13 +96,12 @@ class Utils services_fees.amount as montant, acc_transactions_users.id_user as idUser, acc_transactions_lines.credit as versement, - membres.id as idMembre, membres.nom as nom, membres.adresse as adresse, membres.ville as ville, membres.code_postal as codePostal, membres.email as courriel, - acc_transactions.date as Date, + acc_transactions.date, acc_transactions_users.id_transaction as idTrans FROM acc_transactions_users INNER JOIN membres on acc_transactions_users.id_user = membres.id @@ -125,10 +124,11 @@ class Utils * @param $activite * @param $tarif */ - public static function getVersementsActivite($annee, $activite, $tarif) + public static function getVersementsActivite($annee, $lesTarifs) { - $sql = - "SELECT + $db = DB::getInstance(); + $sql = sprintf( + 'SELECT services.id as idActivite, services_fees.id as idTarif, services.label as activite, @@ -137,7 +137,11 @@ class Utils acc_transactions_users.id_user as idUser, acc_transactions_lines.credit as versement, membres.nom as nom, - acc_transactions.date as Date, + membres.adresse as adresse, + membres.ville as ville, + membres.code_postal as codePostal, + membres.email as courriel, + acc_transactions.date, acc_transactions_users.id_transaction as idTrans FROM acc_transactions_users INNER JOIN membres on acc_transactions_users.id_user = membres.id @@ -147,15 +151,16 @@ class Utils INNER JOIN services_fees on services_users.id_fee = services_fees.id INNER JOIN acc_transactions_lines on acc_transactions_lines.id_transaction = acc_transactions.id WHERE - (strftime(\"%Y\", acc_transactions.date) = ? + (strftime(%s, acc_transactions.date) = "%d" AND - services.id = ? - AND - services_fees.id = ? + services_fees.%s AND acc_transactions_lines.credit > 0) - ORDER by membres.nom, acc_transactions.date"; - return DB::getInstance()->get($sql, $annee, $activite, $tarif); + ORDER by membres.nom, acc_transactions.date', + '"%Y"', + $annee, + $db->where('id', $lesTarifs)); + return $db->get($sql); } /** @@ -230,9 +235,13 @@ class Utils return $anneesFiscales; } - // ------------------------------------------------------------------------ - // zip archive creation - // ------------------------------------------------------------------------ + /** TODO + * générer les reçus + * @param tableau des versements par personne + */ + static function genererRecus() { + + } /** * enregistrer les fichiers dans une archive zip diff --git a/templates/_nav.tpl b/templates/_nav.tpl index 5908a88..3c501aa 100644 --- a/templates/_nav.tpl +++ b/templates/_nav.tpl @@ -5,8 +5,8 @@