diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 8986ad9267f..9fab72b2b51 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copytight (C) 2004 Christophe Combelles * Copytight (C) 2005-2009 Regis Houssin * @@ -680,7 +680,7 @@ if ($account || $_GET["ref"]) // Show total if ($page == 0 && ! $mode_search) { - print ''; + print ''; if ($sep) print ' '; else print $langs->trans("CurrentBalance"); print ''; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index d3b584cde03..e7d1d29905b 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -40,6 +40,16 @@ $year=$_GET["year"]; $filtre=$_GET["filtre"]; if (! $year && $_GET["mode"] != 'sconly') { $year=date("Y", time()); } +$sortfield = isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; +$sortorder = isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; +$page = $_GET["page"]; +if ($page < 0) $page = 0; + +//$limit = $conf->liste_limit; +//$offset = $limit * $page ; + +if (! $sortfield) $sortfield="s.date_ech"; +if (! $sortorder) $sortorder="DESC"; /* @@ -69,15 +79,21 @@ if ($_GET["mode"] != 'sconly') { print_titre($langs->trans("SocialContributionsPayments")); } + +if ($_GET["mode"] == 'sconly') +{ + $param='&mode=sconly'; +} + print ''; print ""; -print ''; -print ''; -print ""; -print '"; -print '"; -print '"; -print '"; +print_liste_field_titre($langs->trans("PeriodEndDate"),$_SERVER["PHP_SELF"],"s.date_ech","",$param,'width="120"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"c.libelle","",$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"s.fk_type","",$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("ExpectedToPay"),$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("RefPayment"),$_SERVER["PHP_SELF"],"pid","",$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"datep","",$param,'align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"pc.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $sql = "SELECT c.id, c.libelle as lib,"; @@ -97,8 +113,8 @@ if ($year > 0) $sql .= "or (s.periode is null and date_format(s.date_ech, '%Y') = $year)"; $sql .= ")"; } -$sql.= " GROUP BY c.id, c.libelle, s.rowid, s.fk_type, s.periode, s.date_ech, pc.rowid, pc.datep, pc.amount"; -$sql.= " ORDER BY c.libelle ASC"; +$sql.= $db->order($sortfield,$sortorder); +//$sql.= $db->plimit($limit+1,$offset); dol_syslog("compta/charges/index.php: select payment sql=".$sql); $resql=$db->query($sql); @@ -116,21 +132,28 @@ if ($resql) $obj = $db->fetch_object($resql); $var = !$var; print ""; + // Date $date=$obj->periode; if (empty($date)) $date=$obj->date_ech; print ''; - print ''; + // Type print ''; + // Expected to pay print ''; - + // Ref payment $payment_sc_static->id=$obj->pid; $payment_sc_static->ref=$obj->pid; - print '\n"; + print '\n"; + // Date payment print ''; + // Paid print ''; print ''; $total = $total + $obj->total; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 4786cb1e4f9..485b872a94f 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -71,7 +71,6 @@ else * View */ - llxHeader(); $html = new Form($db); @@ -100,7 +99,7 @@ if ($filtre) { if ($typeid) { $sql .= " AND s.fk_type=".$typeid; } -$sql.=$db->order($sortfield,$sortorder); +$sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1,$offset);
'.$langs->trans("PeriodEndDate").''.$langs->trans("Label").'".$langs->trans("Type")."'.$langs->trans("ExpectedToPay")."'.$langs->trans("RefPayment")."'.$langs->trans("DatePayment")."'.$langs->trans("PayedByThisPayment")."
'.dol_print_date($date,'day').''; + // Label + print ''; $socialcontrib->id=$obj->rowid; + $socialcontrib->ref=$obj->libelle; $socialcontrib->lib=$obj->libelle; print $socialcontrib->getNomUrl(1,'20'); print ''.$obj->lib.''.price($obj->total).''.$payment_sc_static->getNomUrl(1)."'.$payment_sc_static->getNomUrl(1)."'.dol_print_date($db->jdate($obj->datep),'day').''.price($obj->totalpaye).'