diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 4f8fca43f72..89230e8053a 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -64,12 +64,8 @@ if ($_GET["action"] == 'del') } } -if ($_GET["action"] == 'edit') -{ - print "La modification est le paiement des charges n'est pas encore disponible.\nSeule leur saisie est possible, sans interaction avec le compte pour l'instant.\n"; -} - - +$year=$_GET["year"]; +$filtre=$_GET["filtre"]; /* * Affichage liste et formulaire des charges. @@ -77,20 +73,36 @@ if ($_GET["action"] == 'edit') print_titre("Charges sociales $year"); +print "
\n"; + print ""; print ""; -print ''; +print ''; print "\n"; -$sql = "SELECT s.rowid as id, 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 periode,".$db->pdate("s.date_pai")." as dp"; +$sql = "SELECT s.rowid as id, c.libelle as type, s.amount,".$db->pdate("s.date_ech")." as de, s.date_pai, s.libelle, s.paye,".$db->pdate("s.periode")." as periode,".$db->pdate("s.date_pai")." as dp"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."chargesociales as s"; $sql .= " WHERE s.fk_type = c.id"; if ($year > 0) { - $sql .= " AND date_format(s.periode, '%Y') = $year"; + $sql .= " AND date_format(s.periode, '%Y') = $year"; +} +if ($filtre) { + $filtre=ereg_replace(":","=",$filtre); + $sql .= " AND $filtre"; } $sql .= " ORDER BY lower(s.date_ech) DESC"; @@ -102,6 +114,7 @@ if ( $db->query($sql) ) while ($i < $num) { $obj = $db->fetch_object( $i); + $var = !$var; print ""; print ''; @@ -112,16 +125,16 @@ if ( $db->query($sql) ) print ' '; } print ''; - print ''; + print ''; print ''; if ($obj->paye) { - print ''; + print ''; print ''; } else { - print ''; - print ''; + print ''; } print ''; @@ -132,9 +145,9 @@ else { print $db->error(); } + /* - * - * + * Forumalaire d'ajout d'une charge * */ print ''; @@ -142,10 +155,9 @@ print ''; print ''; print ''; -print ''; +print ''; +print ''; print ''; print '';
Echeance/DatePériode'; -print_liste_field_titre("Libellé",$PHP_SELF,"c.libelle"); -print 'MontantPayé '; +print_liste_field_titre("Echéance/Date",$PHP_SELF,"de"); +print ''; +print_liste_field_titre("Période",$PHP_SELF,"periode"); +print ''; +print_liste_field_titre("Type",$PHP_SELF,"type"); +print ''; +print_liste_field_titre("Libellé",$PHP_SELF,"s.libelle"); +print ''; +print_liste_field_titre("Montant",$PHP_SELF,"s.amount"); +print ''; +print_liste_field_titre("Payé",$PHP_SELF,"s.paye"); +print ' 
'.strftime("%d %b %y",$obj->de).''.$obj->nom.''.$obj->libelle.''.$obj->type.''.$obj->libelle.''.price($obj->amount).''.strftime("%d/%m/%y",$obj->dp).''.strftime("%d/%m/%y",$obj->dp).' Non'.img_edit().''; + print 'Non'.img_edit().''; print '   '.img_delete().'
YYYYMMDD '; - -print '