From 46a88944fc2736c36dc9822ae8cfc72be65bf64f Mon Sep 17 00:00:00 2001 From: engel <> Date: Wed, 26 Jan 2022 11:12:42 +0000 Subject: [PATCH] =?UTF-8?q?R=C3=A9organistion=20fichiers=20;=20ajout=20ges?= =?UTF-8?q?tion=20versements=20totaux=20par=20personne=20;=20montants=20g?= =?UTF-8?q?=C3=A9r=C3=A9s=20en=20centimes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FossilOrigin-Name: e1e11bdd898e24dc30d3a6f150e9679ed2d6bf915ac828cdfbb830b118651b8f --- lib/Services.php | 44 +++++++++++-- templates/_nav.tpl | 11 ++++ templates/activites.tpl | 31 +++++++++ templates/index.tpl | 139 +++++++++++---------------------------- templates/versements.tpl | 114 ++++++++++++++++++++++++++++++++ www/admin/action.php | 6 +- www/admin/activites.php | 14 ++++ www/admin/index.php | 19 +----- www/admin/script.js | 24 ++++++- www/admin/style.css | 9 ++- www/admin/versements.php | 24 +++++++ 11 files changed, 308 insertions(+), 127 deletions(-) create mode 100644 templates/_nav.tpl create mode 100644 templates/activites.tpl create mode 100644 templates/versements.tpl create mode 100644 www/admin/activites.php create mode 100644 www/admin/versements.php diff --git a/lib/Services.php b/lib/Services.php index b1b62a4..f71b1a5 100644 --- a/lib/Services.php +++ b/lib/Services.php @@ -33,7 +33,7 @@ class Services services_fees.id as idTarif, services_fees.label as titreTarif, services_fees.description as descTarif, - printf(\"%.2f\", services_fees.amount/100) as montantTarif + services_fees.amount as montantTarif FROM services_fees WHERE services_fees.id_service = ?", $activite @@ -92,9 +92,9 @@ class Services services_fees.id as idTarif, services.label as activite, services_fees.label as tarif, - printf(\"%8.2f\", services_fees.amount/100) as montant, + services_fees.amount as montant, acc_transactions_users.id_user as idUser, - printf(\"%8.2f\", acc_transactions_lines.credit/100) as versement, + acc_transactions_lines.credit as versement, membres.id as idMembre, membres.nom as nom, membres.adresse as adresse, @@ -132,9 +132,9 @@ class Services services_fees.id as idTarif, services.label as activite, services_fees.label as tarif, - printf(\"%8.2f\", services_fees.amount/100) as montant, + services_fees.amount as montant, acc_transactions_users.id_user as idUser, - printf(\"%8.2f\", acc_transactions_lines.credit/100) as versement, + acc_transactions_lines.credit as versement, membres.nom as nom, acc_transactions.date as Date, acc_transactions_users.id_transaction as idTrans @@ -157,6 +157,40 @@ class Services return DB::getInstance()->get($sql, $annee, $activite, $tarif); } + /** + * liste du total de versements par personne pour une année donnée + * @param année + */ + public static function getVersementsTotaux($annee) { + $sql = + "SELECT + acc_transactions_users.id_user as id, + membres.nom as nom, + sum(acc_transactions_lines.credit) AS montant, + membres.adresse as adresse, + membres.code_postal as codePostal, + membres.ville as ville + 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 NOCASE; + "; + return DB::getInstance()->get($sql, $annee); + } + /** * @return nom de l'association */ diff --git a/templates/_nav.tpl b/templates/_nav.tpl new file mode 100644 index 0000000..e6bcc22 --- /dev/null +++ b/templates/_nav.tpl @@ -0,0 +1,11 @@ + +{include file="admin/_head.tpl" title="%s"|args:$plugin.nom current="plugin_%s"|args:$plugin.id} + + + diff --git a/templates/activites.tpl b/templates/activites.tpl new file mode 100644 index 0000000..fd5f96c --- /dev/null +++ b/templates/activites.tpl @@ -0,0 +1,31 @@ + +{include file="%s/templates/_nav.tpl"|args:$plugin_root current_nav="activites"} + +
Nom | +Description | +Tarif | +Description | +N° Compte | +Nom Compte | +
---|---|---|---|---|---|
{$activite.label} | +{$activite.descService} | +{$activite.tarif} | +{$activite.descTarif} | +{$activite.numero_cpt} | +{$activite.nom_cpt} | +