From 4e0088988e9612e4f326fdc444ccfb3cfc0ef13b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 31 May 2006 12:58:04 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20erreur=20si=20le=20pr=E9fix=20contient?= =?UTF-8?q?=20des=20apostrophes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/fichinter/fichinter.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/fichinter/fichinter.class.php b/htdocs/fichinter/fichinter.class.php index 5faa3aab440..d5affecb7e7 100644 --- a/htdocs/fichinter/fichinter.class.php +++ b/htdocs/fichinter/fichinter.class.php @@ -146,9 +146,10 @@ class Fichinter */ function get_new_num($societe) { - + $socprefix = sanitize_string($societe->prefix_comm); + $sql = "SELECT max(ref) FROM ".MAIN_DB_PREFIX."fichinter"; - $sql.= " WHERE ref like 'FI".$societe->prefix_comm."%'"; + $sql.= " WHERE ref like 'FI".$socprefix."%'"; $result=$this->db->query($sql); if ($result) @@ -170,7 +171,7 @@ class Fichinter $num = $num + 1; //$num = '0000' . $num; //$num = 'FI-' . $prefix_comm . '-' . substr($num, strlen($num) - 4, 4); - $num = 'FI-' . $societe->prefix_comm . '-' . $num; + $num = 'FI-' . $socprefix . '-' . $num; return $num; } }