Merge pull request #5932 from defrance/patch-35

bad setting on get_entity fournisseur
This commit is contained in:
Juanjo Menent 2016-10-28 11:14:57 +02:00 committed by GitHub
commit e1ee9f8661

View File

@ -2014,7 +2014,7 @@ class Product extends CommonObject
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE c.rowid = cd.fk_commande";
$sql.= " AND c.fk_soc = s.rowid";
$sql.= " AND c.entity IN (".getEntity('commande_fourniseur', 1).")";
$sql.= " AND c.entity IN (".getEntity('commande_fournisseur', 1).")";
$sql.= " AND cd.fk_product = ".$this->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid > 0) $sql.= " AND c.fk_soc = ".$socid;