From af9a4edadc271ab965bfd348a0eeab0783b224c2 Mon Sep 17 00:00:00 2001 From: Regis Houssin <regis@dolibarr.fr> Date: Thu, 6 Jul 2006 14:07:33 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20probl=E8me=20de=20num=E9rotation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/fichinter/fiche.php | 17 +---------------- htdocs/fichinter/fichinter.class.php | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 44d4a55daf5..4f6cf6d5744 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -139,22 +139,7 @@ if ($_GET["action"] == 'create') print_titre($langs->trans("AddIntervention")); // \todo Utiliser un module de num�rotation - $numpr = "FI".strftime("%y%m%d", time()); - - $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."propal"; - $sql.= " WHERE ref like '${numpr}%'"; - - $resql=$db->query($sql); - if ($resql) - { - $obj=$db->fetch_object($resql); - $num = $obj->nb; - $db->free($resql); - if ($num > 0) - { - $numpr .= "." . ($num + 1); - } - } + $fix = new Fichinter($db); diff --git a/htdocs/fichinter/fichinter.class.php b/htdocs/fichinter/fichinter.class.php index 8fbb2e6994e..344f280ee56 100644 --- a/htdocs/fichinter/fichinter.class.php +++ b/htdocs/fichinter/fichinter.class.php @@ -155,7 +155,7 @@ class Fichinter extends CommonObject $socprefix = sanitize_string($societe->prefix_comm); $sql = "SELECT max(ref) FROM ".MAIN_DB_PREFIX."fichinter"; - $sql.= " WHERE ref like 'FI".$socprefix."%'"; + $sql.= " WHERE ref like 'FI-".$socprefix."%'"; $result=$this->db->query($sql); if ($result) -- GitLab