diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php
index dbbb444a1f7..e329a2440dc 100644
--- a/htdocs/adherents/cotisations.php
+++ b/htdocs/adherents/cotisations.php
@@ -54,7 +54,24 @@ $offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
-
+$sql = "SELECT c.cotisation, ".$db->pdate("c.dateadh")." as dateadh";
+$sql .= " FROM llx_adherent as d, llx_cotisation as c";
+$sql .= " WHERE d.rowid = c.fk_adherent";
+if(isset($date_select) && $date_select != ''){
+ $sql .= " AND dateadh LIKE '$date_select%'";
+}
+$result = $db->query($sql);
+if ($result)
+{
+ $num = $db->num_rows();
+ $i = 0;
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object( $i);
+ $Total[strftime("%Y",$objp->dateadh)]+=price($objp->cotisation);
+ $i++;
+ }
+}
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, c.cotisation, ".$db->pdate("c.dateadh")." as dateadh";
$sql .= " FROM llx_adherent as d, llx_cotisation as c";
$sql .= " WHERE d.rowid = c.fk_adherent";
@@ -70,6 +87,19 @@ if ($result)
$i = 0;
print_barre_liste("Liste des cotisations", $page, $PHP_SELF, "&statut=$statut");
+
+ print "
\n";
+ print '';
+ print "| Annee | ";
+ print "Montant | ";
+ // print "Prenom Nom / Société | ";
+ print "
\n";
+ foreach ($Total as $key=>$value){
+ $var=!$var;
+ print "| $key | ".price($value)." |
\n";
+ }
+ print "
\n";
+
print "";
print "
\n";
- print "\n";
- print '';
- print "| Annee | ";
- print "Montant | ";
- // print "Prenom Nom / Société | ";
- print "
\n";
- foreach ($Total as $key=>$value){
- $var=!$var;
- print "| $key | ".price($value)." |
\n";
- }
- print "
";
+
}
else
{