Bugfix calcolo numero in copia preventivo

This commit is contained in:
Matteo 2019-01-14 19:28:08 +01:00 committed by GitHub
parent 047dfd34fe
commit f9c02a2182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -109,7 +109,7 @@ switch (post('op')) {
$rs = $dbo->fetchArray('SELECT numero FROM co_preventivi WHERE numero LIKE('.prepare(Util\Generator::complete($numeropreventivo_template)).') ORDER BY numero DESC LIMIT 0,1'); $rs = $dbo->fetchArray('SELECT numero FROM co_preventivi WHERE numero LIKE('.prepare(Util\Generator::complete($numeropreventivo_template)).') ORDER BY numero DESC LIMIT 0,1');
$numero = Util\Generator::generate(setting('Formato codice preventivi'), $rs[0]['numero']); $numero = Util\Generator::generate(setting('Formato codice preventivi'), $rs[0]['numero']);
$dbo->query('UPDATE co_preventivi SET idstato=1, numero = '.$numero.', master_revision = id WHERE id='.prepare($id_record)); $dbo->query('UPDATE co_preventivi SET idstato=1, numero = '.prepare($numero).', master_revision = id WHERE id='.prepare($id_record));
//copio anche le righe del preventivo //copio anche le righe del preventivo
$dbo->query('CREATE TEMPORARY TABLE tmp SELECT * FROM co_righe_preventivi WHERE idpreventivo = '.filter('id_record')); $dbo->query('CREATE TEMPORARY TABLE tmp SELECT * FROM co_righe_preventivi WHERE idpreventivo = '.filter('id_record'));