mirror of
https://github.com/devcode-it/openstamanager.git
synced 2024-12-26 15:54:17 +01:00
Finalizzata duplica preventivo
This commit is contained in:
parent
1037aae3c7
commit
db2fd236c8
@ -153,7 +153,14 @@ switch (post('op')) {
|
||||
$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));
|
||||
|
||||
|
||||
//copio anche le righe del preventivo
|
||||
$dbo->query('CREATE TEMPORARY TABLE tmp SELECT * FROM co_righe_preventivi WHERE idpreventivo = '.filter('id_record'));
|
||||
$dbo->query('ALTER TABLE tmp DROP id');
|
||||
$dbo->query('UPDATE tmp SET idpreventivo = '.prepare($id_record));
|
||||
$dbo->query('INSERT INTO co_righe_preventivi SELECT NULL,tmp.* FROM tmp');
|
||||
$dbo->query('DROP TEMPORARY TABLE tmp');
|
||||
|
||||
flash()->info(tr('Preventivo duplicato correttamente!'));
|
||||
|
||||
break;
|
||||
|
@ -54,10 +54,10 @@ echo ' </div>';
|
||||
echo ' </div>';
|
||||
echo " <div class='row'>";
|
||||
echo " <div class='col-md-12 text-center'>";
|
||||
echo " <button type='submit' class='btn btn-primary'><i class='fa fa-refresh'></i> Cambia revisione...</button>";
|
||||
echo ' </div>';
|
||||
echo ' </div>';
|
||||
echo '</form>';
|
||||
echo " <button ".((sizeof($rs_revisioni)<2) ? 'disabled' : '')." type='submit' class='btn btn-primary' ><i class='fa fa-refresh'></i> ".tr('Cambia revisione')."</button>";
|
||||
echo " </div>";
|
||||
echo " </div>";
|
||||
echo "</form>";
|
||||
|
||||
echo "<form action='".$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$id_record."' method='post' id='form_deleterevision'>";
|
||||
echo " <input type='hidden' name='backto' value='record-edit'>";
|
||||
|
Loading…
Reference in New Issue
Block a user