From abc7198db4e1a66849d4e34046d5c9096e3393ca Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Mon, 28 Oct 2019 12:51:12 +0100 Subject: [PATCH] Fix Multicompany Filter Select only invoice in current company. --- htdocs/margin/customerMargins.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index b3a2c59e63f..32ef5030cb8 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -220,6 +220,7 @@ if ($socid > 0) $sql.= ' AND s.rowid = '.$socid; if (!$user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " AND f.fk_statut NOT IN (" . implode(', ', $invoice_status_except_list) . ")"; $sql.= ' AND s.entity IN ('.getEntity('societe').')'; +$sql.= ' AND f.entity IN ('.getEntity('').')'; $sql.= " AND d.fk_facture = f.rowid"; $sql.= " AND (d.product_type = 0 OR d.product_type = 1)"; if(! empty($TSelectedProducts)) {