From 75f6a6b60cba553df6adb576368a9d7550e9b7b4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 6 May 2006 10:33:53 +0000 Subject: [PATCH] bugfix --- htdocs/expedition/liste.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/liste.php b/htdocs/expedition/liste.php index aa9929be800..1db10526112 100644 --- a/htdocs/expedition/liste.php +++ b/htdocs/expedition/liste.php @@ -59,10 +59,11 @@ llxHeader('',$langs->trans('ListOfSendings'),'ch-expedition.html'); $sql = "SELECT e.rowid, e.ref,".$db->pdate("e.date_expedition")." as date_expedition, e.fk_statut, s.nom as socname, s.idp"; if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user"; -$sql .= " FROM ".MAIN_DB_PREFIX."expedition as e, ".MAIN_DB_PREFIX."societe as s"; +$sql .= " FROM ".MAIN_DB_PREFIX."expedition as e"; if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."commande as c"; if ($socidp) $sql.=", ".MAIN_DB_PREFIX."commande as c"; -$sql_add = " WHERE e.fk_commande = c.rowid AND c.fk_soc = s.idp"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.idp = c.fk_soc"; +$sql_add = " WHERE "; if ($socidp) { $sql.= $sql_add . " e.fk_commande = c.rowid AND c.fk_soc = ".$socidp;