diff --git a/htdocs/fourn/commande/modules/mod_commande_fournisseur_orchidee.php b/htdocs/fourn/commande/modules/mod_commande_fournisseur_orchidee.php index 5c8fa333f19e8e386216ea14f6db36b042a08bf0..d9cf3cf749f5f418c9d863eff1d2b8a05294165d 100644 --- a/htdocs/fourn/commande/modules/mod_commande_fournisseur_orchidee.php +++ b/htdocs/fourn/commande/modules/mod_commande_fournisseur_orchidee.php @@ -173,7 +173,7 @@ function info() $searchyy=''; $sql = "SELECT MAX(ref)"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur"; - if ($conf->global->COMMANDE_FOURNISSEUR_NUM_RESTART_BEGIN_YEAR) $sql.= " WHERE ref like '".$this->searchLast."%'"; + if ($conf->global->COMMANDE_FOURNISSEUR_NUM_RESTART_BEGIN_YEAR) $sql.= " WHERE ref REGEXP '^".$this->searchLast."'"; $resql=$db->query($sql); if ($resql) { @@ -188,7 +188,7 @@ function info() $previousyy=''; $sql = "SELECT MAX(ref)"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur"; - $sql.= " WHERE ref like '".$this->searchLastWithPreviousYear."%'"; + $sql.= " WHERE ref REGEXP '^".$this->searchLastWithPreviousYear."'"; $resql=$db->query($sql); if ($resql) { @@ -203,7 +203,7 @@ function info() // Recherche rapide car restreint par un like sur champ index� $sql = "SELECT MAX(0+SUBSTRING(ref,-".$posindice."))"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur"; - $sql.= " WHERE ref like '${searchyy}%'"; + $sql.= " WHERE ref REGEXP '^".$searchyy."'"; $resql=$db->query($sql); if ($resql) { @@ -375,9 +375,9 @@ function info() // On r�cup�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') diff --git a/htdocs/includes/modules/commande/mod_commande_saphir.php b/htdocs/includes/modules/commande/mod_commande_saphir.php index 5422950443edfe7dc38ee5945a8da42f85e2232a..a237edd544250da93fd4d0a0ad6717c8dd17095f 100644 --- a/htdocs/includes/modules/commande/mod_commande_saphir.php +++ b/htdocs/includes/modules/commande/mod_commande_saphir.php @@ -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� $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�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') diff --git a/htdocs/includes/modules/facture/pluton/pluton.modules.php b/htdocs/includes/modules/facture/pluton/pluton.modules.php index 0273f02272ce6aed1e9c73bc09ecda4daeff8865..99023075962443ee1d84cdedd48b3d5fac1174b1 100644 --- a/htdocs/includes/modules/facture/pluton/pluton.modules.php +++ b/htdocs/includes/modules/facture/pluton/pluton.modules.php @@ -199,7 +199,7 @@ function info() $sql.= " FROM ".MAIN_DB_PREFIX."facture"; if ($conf->global->FACTURE_NUM_RESTART_BEGIN_YEAR) { - $sql.= " WHERE facnumber like '".$this->searchLast."%'"; + $sql.= " WHERE facnumber REGEXP '^".$this->searchLast."'"; } else if ($facture->type == 2) { @@ -219,7 +219,7 @@ function info() $previousyy=''; $sql = "SELECT MAX(facnumber)"; $sql.= " FROM ".MAIN_DB_PREFIX."facture"; - $sql.= " WHERE facnumber like '$".$this->searchLastWithPreviousYear."%'"; + $sql.= " WHERE facnumber REGEXP '^".$this->searchLastWithPreviousYear."'"; $resql=$db->query($sql); if ($resql) { @@ -234,7 +234,7 @@ function info() // Recherche rapide car restreint par un like sur champ index� $sql = "SELECT MAX(0+SUBSTRING(facnumber,-".$posindice."))"; $sql.= " FROM ".MAIN_DB_PREFIX."facture"; - $sql.= " WHERE facnumber like '${searchyy}%'"; + $sql.= " WHERE facnumber REGEXP '^".$searchyy."'"; $resql=$db->query($sql); if ($resql) { @@ -428,9 +428,9 @@ function info() // On r�cup�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') diff --git a/htdocs/includes/modules/propale/mod_propale_saphir.php b/htdocs/includes/modules/propale/mod_propale_saphir.php index 48ac5c59a677c345b1375dc13c788e6a73808c6e..c0e80d48374d8572550b3b2b15e46aece7f78d32 100644 --- a/htdocs/includes/modules/propale/mod_propale_saphir.php +++ b/htdocs/includes/modules/propale/mod_propale_saphir.php @@ -175,7 +175,7 @@ function info() $searchyy=''; $sql = "SELECT MAX(ref)"; $sql.= " FROM ".MAIN_DB_PREFIX."propal"; - if ($conf->global->PROPALE_NUM_RESTART_BEGIN_YEAR) $sql.= " WHERE ref like '".$this->searchLast."%'"; + if ($conf->global->PROPALE_NUM_RESTART_BEGIN_YEAR) $sql.= " WHERE ref REGEXP '^".$this->searchLast."'"; $resql=$db->query($sql); if ($resql) { @@ -190,7 +190,7 @@ function info() $previousyy=''; $sql = "SELECT MAX(ref)"; $sql.= " FROM ".MAIN_DB_PREFIX."propal"; - $sql.= " WHERE ref like '".$this->searchLastWithPreviousYear."%'"; + $sql.= " WHERE ref REGEXP '^".$this->searchLastWithPreviousYear."'"; $resql=$db->query($sql); if ($resql) { @@ -205,7 +205,7 @@ function info() // Recherche rapide car restreint par un like sur champ index� $sql = "SELECT MAX(0+SUBSTRING(ref,-".$posindice."))"; $sql.= " FROM ".MAIN_DB_PREFIX."propal"; - $sql.= " WHERE ref like '${searchyy}%'"; + $sql.= " WHERE ref like '^".$searchyy."'"; $resql=$db->query($sql); if ($resql) { @@ -366,9 +366,9 @@ function info() // On r�cup�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') diff --git a/htdocs/livraison/mods/mod_livraison_saphir.php b/htdocs/livraison/mods/mod_livraison_saphir.php index 2e53de5d29de8d3f32ae977bf3ca8c9f235bcfe7..9a33dc0df6a076414bd60d03b2cc58ffe8a2291a 100644 --- a/htdocs/livraison/mods/mod_livraison_saphir.php +++ b/htdocs/livraison/mods/mod_livraison_saphir.php @@ -176,7 +176,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder $searchyy=''; $sql = "SELECT MAX(ref)"; $sql.= " FROM ".MAIN_DB_PREFIX."livraison"; - if ($conf->global->LIVRAISON_NUM_RESTART_BEGIN_YEAR) $sql.= " WHERE ref like '".$this->searchLast."%'"; + if ($conf->global->LIVRAISON_NUM_RESTART_BEGIN_YEAR) $sql.= " WHERE ref REGEXP '^".$this->searchLast."'"; $resql=$db->query($sql); if ($resql) { @@ -191,7 +191,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder $previousyy=''; $sql = "SELECT MAX(ref)"; $sql.= " FROM ".MAIN_DB_PREFIX."livraison"; - $sql.= " WHERE ref like '".$this->searchLastWithPreviousYear."%'"; + $sql.= " WHERE ref REGEXP '^".$this->searchLastWithPreviousYear."'"; $resql=$db->query($sql); if ($resql) { @@ -206,7 +206,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder // Recherche rapide car restreint par un like sur champ index� $sql = "SELECT MAX(0+SUBSTRING(ref,-".$posindice."))"; $sql.= " FROM ".MAIN_DB_PREFIX."livraison"; - $sql.= " WHERE ref like '${searchyy}%'"; + $sql.= " WHERE ref REGEXP '^".$searchyy."'"; $resql=$db->query($sql); if ($resql) { @@ -379,9 +379,9 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder // On r�cup�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')