Merge pull request #10323 from mapiolca/patch-7

FIX Multicompany
This commit is contained in:
Laurent Destailleur 2019-01-10 14:04:30 +01:00 committed by GitHub
commit fecccaa8ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,7 @@ if ($id > 0 || ! empty($ref))
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.fk_statut > 0";
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND f.entity IN (".getEntity('invoice').");
$sql.= " AND d.fk_facture = f.rowid";
$sql.= " AND d.fk_product =".$object->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;