Fix: problme de numrotation
This commit is contained in:
parent
52b6e717e6
commit
af9a4edadc
@ -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);
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user