diff --git a/htdocs/includes/boxes/box_actions.php b/htdocs/includes/boxes/box_actions.php index 66f29599cc5..039d227fd59 100644 --- a/htdocs/includes/boxes/box_actions.php +++ b/htdocs/includes/boxes/box_actions.php @@ -73,9 +73,9 @@ class box_actions extends ModeleBoxes { $sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,"; $sql.= " ta.code,"; $sql.= " s.nom, s.rowid as socid"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm AS ta, "; + $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, "; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " ".MAIN_DB_PREFIX."societe_commerciaux AS sc, "; - $sql.= MAIN_DB_PREFIX."actioncomm AS a"; + $sql.= MAIN_DB_PREFIX."actioncomm AS a)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")"; $sql.= " WHERE a.fk_action = ta.id"; $sql.= " AND a.entity = ".$conf->entity;