From 5c9d5bb6ad53c825e42532afeecb6c0b0c735c07 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Fri, 23 Nov 2018 21:30:34 +0100 Subject: [PATCH] order by category --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 40a7a47a94f..721c1997086 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2014,6 +2014,9 @@ class Form $selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression"; (count($warehouseStatusArray)) ? $selectFieldsGrouped = ", sum(ps.reel) as stock" : $selectFieldsGrouped = ", p.stock"; + $sql = "SELECT "; + $sql.= $selectFields . $selectFieldsGrouped; + //Product category $sql.= ", (SELECT ".MAIN_DB_PREFIX."categorie_product.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_product @@ -2021,9 +2024,6 @@ class Form LIMIT 1 ) AS categorie_product_id "; - $sql = "SELECT "; - $sql.= $selectFields . $selectFieldsGrouped; - //Price by customer if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {