Skip to content
Snippets Groups Projects
Commit af9a4eda authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: problème de numérotation

parent 52b6e717
No related branches found
No related tags found
No related merge requests found
...@@ -139,22 +139,7 @@ if ($_GET["action"] == 'create') ...@@ -139,22 +139,7 @@ if ($_GET["action"] == 'create')
print_titre($langs->trans("AddIntervention")); print_titre($langs->trans("AddIntervention"));
// \todo Utiliser un module de numrotation // \todo Utiliser un module de numrotation
$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); $fix = new Fichinter($db);
......
...@@ -155,7 +155,7 @@ class Fichinter extends CommonObject ...@@ -155,7 +155,7 @@ class Fichinter extends CommonObject
$socprefix = sanitize_string($societe->prefix_comm); $socprefix = sanitize_string($societe->prefix_comm);
$sql = "SELECT max(ref) FROM ".MAIN_DB_PREFIX."fichinter"; $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); $result=$this->db->query($sql);
if ($result) if ($result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment