dbut ajout possibilit de dterminer si le contenu d'une catgorie sera visible ou
non dans la liste des produits/services, ceci afin de pouvoir cacher les sous-produits par exemple.
This commit is contained in:
parent
bd40959922
commit
c3804bdac3
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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) ;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user