Fix: Sql error

This commit is contained in:
Laurent Destailleur 2011-04-17 13:29:47 +00:00
parent 54a57941a0
commit a3fb6efe69

View File

@ -73,9 +73,9 @@ class box_actions extends ModeleBoxes {
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,"; $sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,";
$sql.= " ta.code,"; $sql.= " ta.code,";
$sql.= " s.nom, s.rowid as socid"; $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, "; 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"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe AS s ON a.fk_soc = s.rowid";
$sql.= " WHERE a.fk_action = ta.id"; $sql.= " WHERE a.fk_action = ta.id";
$sql.= " AND a.percent <> 100"; $sql.= " AND a.percent <> 100";