diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 24c9d37b862dd..3d8b3ce8037d6 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2011 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,10 +20,10 @@ */ /** - \file htdocs/compta/deplacement/index.php - \brief Page liste des deplacements - \version $Id$ -*/ + * \file htdocs/compta/deplacement/index.php + * \brief Page liste des deplacements + * \version $Id$ + */ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/compta/tva/class/tva.class.php"); @@ -58,7 +58,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= ", ".MAIN_DB_PREFIX."deplacement as d"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on d.fk_soc = s.rowid"; -if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; +if (!$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; $sql.= " WHERE d.fk_user = u.rowid"; $sql.= " AND d.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id;