Skip to content
Snippets Groups Projects
Commit 587a193a authored by AlainRnet's avatar AlainRnet
Browse files

Update lines.php

- pagination
- prise en compte des filtres lors d'un changement de page
parent 5d34f787
No related branches found
No related tags found
No related merge requests found
......@@ -184,6 +184,14 @@ if (strlen(trim($search_vat)))
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
}
// Count total nb of records with no order and no limits
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);
if ($resql) $nbtotalofrecords = $db->num_rows($resql);
else dol_print_error($db);
}
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1,$offset);
......@@ -192,9 +200,17 @@ $result = $db->query($sql);
if ($result) {
$num_lines = $db->num_rows($result);
$i = 0;
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
$param="";
if ($search_login) $param.="&search_login=".$search_login;
if ($search_facture) $param.="&search_facture=".$search_facture;
if ($search_ref) $param.="&search_ref=".$search_ref;
if ($search_label) $param.="&search_label=".$search_label;
if ($search_desc) $param.="&search_desc=".$search_desc;
if ($search_account) $param.="&search_account=".$search_account;
if ($filter) $param.="&filter=".$filter;
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines,$nbtotalofrecords);
print '<td align="left"><b>' . $langs->trans("DescVentilDoneCustomer") . '</b></td>';
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
......@@ -277,5 +293,10 @@ if ($result) {
print "</table></form>";
if ($num_lines > $conf->liste_limit)
{
print_barre_liste('',$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num_lines,$nbtotalofrecords,'');
}
llxFooter();
$db->close();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment