diff --git a/htdocs/compta/sociales/index.php3 b/htdocs/compta/sociales/index.php3 index 80c6785668d..120fecd36f7 100644 --- a/htdocs/compta/sociales/index.php3 +++ b/htdocs/compta/sociales/index.php3 @@ -55,7 +55,7 @@ if ($action == 'del_bookmark') { $result = $db->query($sql); } -print_titre("Charges"); +print_titre("Charges $year"); /* * @@ -64,13 +64,16 @@ print_titre("Charges"); print ""; print ""; -print ''; +print ''; print "\n"; -$sql = "SELECT c.libelle as nom, s.amount, s.date_ech, s.date_pai, s.libelle, s.paye"; +$sql = "SELECT c.libelle as nom, s.amount,".$db->pdate("s.date_ech")." as de, s.date_pai, s.libelle, s.paye,".$db->pdate("s.periode")." as dp"; $sql .= " FROM c_chargesociales as c, llx_chargesociales as s"; $sql .= " WHERE s.fk_type = c.id"; +if ($year > 0) { + $sql .= " AND date_format(s.periode, '%Y') = $year"; +} $sql .= " ORDER BY lower(s.date_ech) DESC"; if ( $db->query($sql) ) { @@ -81,7 +84,8 @@ if ( $db->query($sql) ) { $obj = $db->fetch_object( $i); $var = !$var; print ""; - print ''; + print ''; + print ''; print ''; print ''; print '
DateChargesMontant EcheancePériodeChargesMontant 
'.$obj->date_ech.''.strftime("%d/%m/%y",$obj->de).'dp).'">'.strftime("%Y",$obj->dp).''.$obj->nom.''.$obj->libelle.''.price($obj->amount).'';