diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index efb008df4ff3225fdb5ba071172d7f1f64f3e223..5cf237050ddf39197b9b1b020b4516da06655972 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -57,6 +57,9 @@ $texte = ''; $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); +if ($page == -1) { $page = 0; } +$limit = $conf->liste_limit; +$offset = $limit * $page ; if (!$sortfield) { $sortfield = 'p.ref'; @@ -65,11 +68,6 @@ if (!$sortfield) { if (!$sortorder) { $sortorder = 'ASC'; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; - -// Force limit to no (currently solution to solve loosing selection when using pagination. No pagination on this page) -$limit = 0; /* @@ -309,7 +307,7 @@ if ($usevirtualstock) } $sql.= $db->order($sortfield,$sortorder); -$sql.= $db->plimit($limit, $offset); +$sql.= $db->plimit($limit + 1, $offset); //print $sql; $resql = $db->query($sql);