diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 44d4a55daf50f7708345c2a9cef0b47017b9b78e..4f6cf6d57441962f5a8cfb2227191f7deaca96a9 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 8fbb2e6994e2a92a6d86d1f1097c977f81fc988b..344f280ee565fe3996adcde082fdc1d165dec52e 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)