diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 33082aa9193bd12c244b09071cd1b0017e860ffb..b567773bc695fc58df1275de8c4d857ca5c54379 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -67,7 +67,7 @@ $sql = "SELECT e.rowid, e.ref"; $sql.= ", s.nom, s.rowid as socid"; $sql.= ", c.ref as commande_ref, c.rowid as commande_id"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; if (!$user->rights->societe->client->voir && !$socid)