order by category

This commit is contained in:
wdammak 2018-11-23 21:27:22 +01:00 committed by GitHub
parent 064816242a
commit 5c3daf4a6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2013,10 +2013,6 @@ 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";
$selectFields .= ", pcat.fk_categorie as categorie_product_id";
$sql = "SELECT ";
$sql.= $selectFields . $selectFieldsGrouped;
//Product category
$sql.= ", (SELECT ".MAIN_DB_PREFIX."categorie_product.fk_categorie
@ -2025,6 +2021,9 @@ 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))
{