diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index a4905c30075..c96d99cba9a 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -346,9 +346,7 @@ class Productcustomerprice extends CommonObject } } } - if (!empty($sortfield)) { - $sql.= $this->db->order($sortfield, $sortorder); - } + $sql.= $this->db->order($sortfield, $sortorder); if (! empty($limit)) $sql .= ' ' . $this->db->plimit($limit + 1, $offset); dol_syslog(get_class($this) . "::fetch_all", LOG_DEBUG); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 9b63b91ece6..cd530ceda6f 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1423,7 +1423,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) // Count total nb of records $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $nbtotalofrecords = $prodcustprice->fetch_all($sortfield, $sortorder, 0, 0, $filter); + $nbtotalofrecords = $prodcustprice->fetch_all($sortorder, $sortfield, 0, 0, $filter); } $result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);