From 4876b36a5364dc45857b356051ee0b5d182f6ade Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 20 Sep 2007 18:48:18 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20bug=20sur=20les=20requ=EAtes=20-=20Merci?= =?UTF-8?q?=20Laurent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/index.php | 10 +++++----- htdocs/includes/boxes/box_factures_imp.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 535470ef52f..44232681110 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -433,7 +433,7 @@ if ($user->rights->societe->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } @@ -493,7 +493,7 @@ if ($user->rights->societe->lire) } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '
'; } @@ -511,9 +511,9 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman $sql.= " s.nom, s.rowid as socid,"; $sql.= " p.rowid, p.ref, p.facture, p.fk_statut, p.total_ht, p.total_ttc"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; - $sql.= " FROM (".MAIN_DB_PREFIX."societe AS s, ".MAIN_DB_PREFIX."commande AS p"; - if ($user->rights->commercial->client->voir || $socid) $sql .= ")"; - if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc)"; + $sql.= " FROM ".MAIN_DB_PREFIX."societe AS s"; + if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= ", ".MAIN_DB_PREFIX."commande AS p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."co_fa AS co_fa ON co_fa.fk_commande = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture AS f ON co_fa.fk_facture = f.rowid"; $sql.= " WHERE p.fk_soc = s.rowid"; diff --git a/htdocs/includes/boxes/box_factures_imp.php b/htdocs/includes/boxes/box_factures_imp.php index 62dfcbc79c0..5d53abd2f8c 100644 --- a/htdocs/includes/boxes/box_factures_imp.php +++ b/htdocs/includes/boxes/box_factures_imp.php @@ -78,7 +78,7 @@ class box_factures_imp extends ModeleBoxes { $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE f.fk_soc = s.rowid AND f.paye=0 AND fk_statut = 1"; - if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id; + if (!$user->rights->commercial->client->voir && !$user->societe_id) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if($user->societe_id) { $sql .= " AND s.rowid = ".$user->societe_id;