From 70cf8227a2c879b91c0ecdfd17302031bb6cff83 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 25 Jul 2012 12:47:50 +0200 Subject: [PATCH] Fix: Products with no prices not visible Conflicts: htdocs/core/class/html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 29baedfc6b5..1d9b1b79520 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1359,10 +1359,10 @@ class Form $sql.= " s.nom"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; + if ($socid) $sql.= " AND pfp.fk_soc = ".$socid; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " AND p.tobuy = 1"; - if ($socid) $sql.= " AND pfp.fk_soc = ".$socid; if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype; if (! empty($filtre)) $sql.=" ".$filtre; // Add criteria on ref/label