From 7e9d6dc153eaf7fc3b1eeed225af1cb1d6467a35 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 24 Oct 2019 10:58:29 +0200 Subject: [PATCH] Fix With pagination it is possible that the searched product does not appear if there are many open supplier orders --- htdocs/product/stock/replenishorders.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php index 942ca82bc04..34dfc2d9d6e 100644 --- a/htdocs/product/stock/replenishorders.php +++ b/htdocs/product/stock/replenishorders.php @@ -2,6 +2,7 @@ /* * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2014 Regis Houssin + * Copyright (C) 2019 Juanjo Menent * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -152,7 +153,9 @@ if (GETPOST('statut', 'int')) { $sql .= ' GROUP BY cf.rowid, cf.ref, cf.date_creation, cf.fk_statut'; $sql .= ', cf.total_ttc, cf.fk_user_author, u.login, s.rowid, s.nom'; $sql .= $db->order($sortfield, $sortorder); -$sql .= $db->plimit($limit+1, $offset); +if (! $sproduct) { + $sql .= $db->plimit($limit+1, $offset); +} $resql = $db->query($sql); if ($resql) @@ -268,7 +271,7 @@ if ($resql) $userstatic = new User($db); - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num,$sproduct?$num:$conf->liste_limit)) { $obj = $db->fetch_object($resql);