mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-07 17:42:53 +01:00
Changement de mthode de numrotation - termin
This commit is contained in:
@@ -82,25 +82,9 @@ class mod_commande_opale extends ModeleNumRefCommandes
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row)
|
||||
{
|
||||
$com = substr($row[0],0,3);
|
||||
//on extrait la valeur max et on la passe en d<>cimale
|
||||
$max = hexdec((substr($row[0],4,3)).(substr($row[0],8,3)));
|
||||
}
|
||||
/*
|
||||
// Si au moins un champ respectant le mod<6F>le a <20>t<EFBFBD> trouv<75>e
|
||||
if (eregi('COM',$cyy))
|
||||
{
|
||||
// Recherche rapide car restreint par un like sur champ index<65>
|
||||
$posindice=4;
|
||||
$sql = "SELECT MAX(0+SUBSTRING(ref,$posindice))";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE ref like '${cyy}%'";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
$max = $row[0];
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -121,34 +105,5 @@ class mod_commande_opale extends ModeleNumRefCommandes
|
||||
{
|
||||
return $this->getNextValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** \brief Renvoie le prochaine num<75>ro de r<>f<EFBFBD>rence de commande non utilis<69>
|
||||
\param obj_soc objet soci<63>t<EFBFBD>
|
||||
\return string num<75>ro de r<>f<EFBFBD>rence de commande non utilis<69>
|
||||
*/
|
||||
/* function commande_get_num($obj_soc=0)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."commande WHERE fk_statut <> 0";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ( $resql )
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
|
||||
$num = $row[0];
|
||||
}
|
||||
|
||||
$hex = strtoupper(dechex($num+1));
|
||||
|
||||
$ref = substr("000000".($hex),-6);
|
||||
|
||||
return 'COM-'.substr($ref,0,3)."-".substr($ref,3,3);
|
||||
}
|
||||
*/
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user