Fix: problme de numrotation

This commit is contained in:
Regis Houssin 2006-07-06 14:07:33 +00:00
parent 52b6e717e6
commit af9a4edadc
2 changed files with 2 additions and 17 deletions

View File

@ -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);

View File

@ -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)