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} | +