From b3259ffb2d6b202eab57ef4f16509d84de851b94 Mon Sep 17 00:00:00 2001 From: xxfuma85xx Date: Fri, 4 Jan 2019 23:26:38 +0100 Subject: [PATCH] Corretto codice intervento Aggiunta correzione per inserire correttamente i modificatori al codice intervento per la ricerca ed elaborazione corretta della sequenza codici --- modules/interventi/add.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/interventi/add.php b/modules/interventi/add.php index 461cbae91..a967c0917 100644 --- a/modules/interventi/add.php +++ b/modules/interventi/add.php @@ -11,13 +11,13 @@ unset($_SESSION['superselect']['non_fatturato']); $idintervento_template = setting('Formato codice intervento'); $idintervento_template = str_replace('#', '%', $idintervento_template); -$rs = $dbo->fetchArray('SELECT codice FROM in_interventi WHERE codice=(SELECT MAX(CAST(codice AS SIGNED)) FROM in_interventi) AND codice LIKE '.prepare($idintervento_template).' ORDER BY codice DESC LIMIT 0,1'); +$rs = $dbo->fetchArray('SELECT codice FROM in_interventi WHERE codice=(SELECT MAX(CAST(codice AS SIGNED)) FROM in_interventi) AND codice LIKE '.prepare(Util\Generator::complete($idintervento_template)).' ORDER BY codice DESC LIMIT 0,1'); if (!empty($rs[0]['codice'])) { $new_codice = Util\Generator::generate(setting('Formato codice intervento'), $rs[0]['codice']); } if (empty($new_codice)) { - $rs = $dbo->fetchArray('SELECT codice FROM in_interventi WHERE codice LIKE '.prepare($idintervento_template).' ORDER BY codice DESC LIMIT 0,1'); + $rs = $dbo->fetchArray('SELECT codice FROM in_interventi WHERE codice LIKE '.prepare(Util\Generator::complete($idintervento_template)).' ORDER BY codice DESC LIMIT 0,1'); $new_codice = Util\Generator::generate(setting('Formato codice intervento'), $rs[0]['codice']); }