forked from Wavyzz/dolibarr
Fix: remplacement de LIKE dans la requete sql par REGEXP afin de palier au diffrent format de numrotation
This commit is contained in:
@@ -175,7 +175,7 @@ function info()
|
||||
$searchyy='';
|
||||
$sql = "SELECT MAX(ref)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
if ($conf->global->COMMANDE_NUM_RESTART_BEGIN_YEAR) $sql.= " WHERE ref like '".$this->searchLast."%'";
|
||||
if ($conf->global->COMMANDE_NUM_RESTART_BEGIN_YEAR) $sql.= " WHERE ref REGEXP '^".$this->searchLast."'";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ function info()
|
||||
$previousyy='';
|
||||
$sql = "SELECT MAX(ref)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE ref like '".$this->searchLastWithPreviousYear."%'";
|
||||
$sql.= " WHERE ref REGEXP '^".$this->searchLastWithPreviousYear."'";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ function info()
|
||||
// Recherche rapide car restreint par un like sur champ index<65>
|
||||
$sql = "SELECT MAX(0+SUBSTRING(ref,-".$posindice."))";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " WHERE ref like '${searchyy}%'";
|
||||
$sql.= " WHERE ref REGEXP '^".$searchyy."'";
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -377,9 +377,9 @@ function info()
|
||||
// On r<>cup<75>re le mois si besoin
|
||||
$this->mm = strftime("%m",time());
|
||||
$this->numMatrice[$k] = '$mm';
|
||||
$this->searchLast .= $this->mm;
|
||||
$this->searchLast .= '[0-9][0-9]';
|
||||
$this->searchLastWithNoYear .= '[0-9][0-9]';
|
||||
$this->searchLastWithPreviousYear .= $this->mm;
|
||||
$this->searchLastWithPreviousYear .= '[0-9][0-9]';
|
||||
$k++;
|
||||
}
|
||||
else if ($idMatrice == 'counter')
|
||||
|
||||
Reference in New Issue
Block a user