From 303f7c227e3f567e8ff1dc3cf12a63c3dabd38b8 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 24 Nov 2003 08:50:17 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20s=E9curit=E9=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture/stats/index.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index eca0ae47607..8d87f388855 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -20,6 +20,14 @@ * */ require("./pre.inc.php"); +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socidp = $user->societe_id; +} llxHeader(); /* @@ -43,6 +51,11 @@ $px->SetHeight(280); $px->draw(DOL_DOCUMENT_ROOT.$filev, $data, $year); $sql = "SELECT count(*), date_format(datef,'%Y') as dm, sum(total) FROM llx_facture WHERE fk_statut > 0 GROUP BY dm DESC "; +if ($socidp) +{ + $sql .= " AND fk_soc = $socidp"; +} + if ($db->query($sql)) { $num = $db->num_rows();