From 0663932589af7b122cab273eca83e85e9d17577f Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 16 Oct 2015 12:51:49 +0200 Subject: [PATCH] Add currently used sortfields and sortorder --- htdocs/fourn/ajax/getSupplierPrices.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 0255764a5d9..4bdfb6ca238 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -49,7 +49,9 @@ if ($idprod > 0) { $producttmp=new ProductFournisseur($db); $producttmp->fetch($idprod); - $productSupplierArray = $producttmp->list_product_fournisseur_price($idprod); + // get supplier prices sorted descending on supplier name and supplier ref + // TODO create configuration to define best price, current is not optimal + $productSupplierArray = $producttmp->list_product_fournisseur_price($idprod, 's.nom, pfp.ref_fourn', 'DESC'); if ( is_array($productSupplierArray)) { foreach ($productSupplierArray as $productSupplier)