Update product.class.php

This commit is contained in:
ptibogxiv 2019-08-24 14:21:41 +02:00 committed by GitHub
parent d22c2960b7
commit 1b4788c6d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3288,7 +3288,8 @@ class Product extends CommonObject
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql.= " WHERE c.rowid = d.fk_contrat";
$sql.= " WHERE c.entity IN (".getEntity('contract').")";
$sql.= " AND c.rowid = d.fk_contrat";
if ($this->id > 0) {
$sql.= " AND d.fk_product =".$this->id;
} else {
@ -3298,7 +3299,6 @@ class Product extends CommonObject
$sql.= " AND p.rowid = d.fk_product AND p.fk_product_type =".$filteronproducttype;
}
$sql.= " AND c.fk_soc = s.rowid";
$sql.= " AND c.entity IN (".getEntity('contract').")";
if (!$user->rights->societe->client->voir && !$socid) {
$sql.= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
}