diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index f600733cfa7..686e6a034f9 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -5,7 +5,7 @@ Services=Services Product=Product Service=Service Create=Create -References=References +Reference=Reference NewProduct=New product NewService=New service ProductCode=Product code diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index b8f239e1350..22ec1f3dc6a 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -5,7 +5,7 @@ Services=Services Product=Produit Service=Service Create=Créer -References=Références +Reference=Référence NewProduct=Nouveau produit NewService=Nouveau service ProductCode=Code produit diff --git a/htdocs/product/stock/entrepot.class.php b/htdocs/product/stock/entrepot.class.php index dcc578f1ce0..f2b513249b1 100644 --- a/htdocs/product/stock/entrepot.class.php +++ b/htdocs/product/stock/entrepot.class.php @@ -281,7 +281,21 @@ class Entrepot */ function nb_products() { - $sql = "SELECT sum(reel) FROM llx_product_stock WHERE fk_entrepot = ".$this->id; + global $conf,$user; + + $sql = "SELECT sum(ps.reel)"; + $sql .= " FROM llx_product_stock as ps"; + if ($conf->categorie->enabled && !$user->rights->categorie->voir) + { + $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; + $sql .= ", ".MAIN_DB_PREFIX."categorie as c"; + } + $sql .= " WHERE ps.fk_entrepot = ".$this->id; + if ($conf->categorie->enabled && !$user->rights->categorie->voir) + { + $sql .= " AND cp.fk_product = ps.fk_product"; + $sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1"; + } $result = $this->db->query($sql) ;