diff --git a/htdocs/includes/boxes/box_factures.php b/htdocs/includes/boxes/box_factures.php index 5fffbe4a225..3c77a3ca3c4 100644 --- a/htdocs/includes/boxes/box_factures.php +++ b/htdocs/includes/boxes/box_factures.php @@ -30,6 +30,10 @@ if ($user->rights->facture->lire) $sql = "SELECT s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid"; $sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp"; + if($user->societe_id) + { + $sql .= " AND s.idp = $user->societe_id"; + } $sql .= " ORDER BY f.datef DESC, f.facnumber DESC "; $sql .= $db->plimit(5, 0); diff --git a/htdocs/includes/boxes/box_factures_imp.php b/htdocs/includes/boxes/box_factures_imp.php index 1cf6f63e1eb..cc87723c012 100644 --- a/htdocs/includes/boxes/box_factures_imp.php +++ b/htdocs/includes/boxes/box_factures_imp.php @@ -29,6 +29,10 @@ if ($user->rights->facture->lire) $sql = "SELECT s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid"; $sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.paye=0 AND fk_statut = 1"; + if($user->societe_id) + { + $sql .= " AND s.idp = $user->societe_id"; + } $sql .= " ORDER BY f.datef DESC, f.facnumber DESC "; $sql .= $db->plimit(5, 0); diff --git a/htdocs/includes/boxes/box_propales.php b/htdocs/includes/boxes/box_propales.php index da118142be4..a6d78757180 100644 --- a/htdocs/includes/boxes/box_propales.php +++ b/htdocs/includes/boxes/box_propales.php @@ -29,6 +29,10 @@ if ($user->rights->propale->lire) $sql = "SELECT s.nom,s.idp,p.ref,".$db->pdate("p.datep")." as dp,p.rowid"; $sql .= " FROM llx_societe as s,llx_propal as p WHERE p.fk_soc = s.idp"; + if($user->societe_id) + { + $sql .= " AND s.idp = $user->societe_id"; + } $sql .= " ORDER BY p.datep DESC, p.ref DESC "; $sql .= $db->plimit(5, 0);