1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-27 08:12:47 +01:00

Finalizzata duplica preventivo

This commit is contained in:
Luca 2018-12-28 00:30:41 +01:00
parent 1037aae3c7
commit db2fd236c8
2 changed files with 12 additions and 5 deletions

View File

@ -154,6 +154,13 @@ switch (post('op')) {
$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;

View File

@ -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'>";