1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-25 06:55:05 +01:00

Bugfix: Una volta associato un intervento al contratto non era più possibile cambiare il contratto.

This commit is contained in:
Luca 2018-08-20 10:57:36 +02:00
parent 3ee12fdd85
commit a96aaa82e0
2 changed files with 5 additions and 5 deletions

View File

@ -59,14 +59,14 @@ $_SESSION['superselect']['idanagrafica'] = $records[0]['idanagrafica'];
<div class="col-md-6">
<?php
$rs = $dbo->fetchArray('SELECT id, idcontratto FROM co_contratti_promemoria WHERE idintervento='.prepare($id_record));
/*$rs = $dbo->fetchArray('SELECT id, idcontratto FROM co_contratti_promemoria WHERE idintervento='.prepare($id_record));
if (count($rs) == 1) {
$idcontratto = $rs[0]['idcontratto'];
$idcontratto_riga = $rs[0]['id'];
} else {
$idcontratto = '';
$idcontratto_riga = '';
}
}*/
if (($idcontratto != '')) {
echo '
@ -74,7 +74,7 @@ $_SESSION['superselect']['idanagrafica'] = $records[0]['idanagrafica'];
}
?>
{[ "type": "select", "label": "<?php echo tr('Contratto'); ?>", "name": "idcontratto", "value": "<?php echo $idcontratto; ?>", "ajax-source": "contratti", "readonly": "<?php echo $records[0]['flag_completato']; ?>" ]}
{[ "type": "select", "label": "<?php echo tr('Contratto'); ?>", "name": "idcontratto", "value": "<?php echo $records[0]['idcontratto']; ?>", "ajax-source": "contratti", "readonly": "<?php echo $records[0]['flag_completato']; ?>" ]}
<input type='hidden' name='idcontratto_riga' value='<?php echo $idcontratto_riga; ?>'>
</div>
</div>

View File

@ -3,7 +3,7 @@
include_once __DIR__.'/../../core.php';
if (isset($id_record)) {
$records = $dbo->fetchArray('SELECT *, (SELECT completato FROM in_statiintervento WHERE idstatointervento=in_interventi.idstatointervento) AS flag_completato, IF((in_interventi.idsede = 0), (SELECT idzona FROM an_anagrafiche WHERE idanagrafica = in_interventi.idanagrafica), (SELECT idzona FROM an_sedi WHERE id = in_interventi.idsede)) AS idzona, (SELECT colore FROM in_statiintervento WHERE idstatointervento=in_interventi.idstatointervento) AS colore, (SELECT idpreventivo FROM co_preventivi_interventi WHERE idintervento=in_interventi.id LIMIT 0,1) AS idpreventivo FROM in_interventi WHERE id='.prepare($id_record).Modules::getAdditionalsQuery($id_module));
$records = $dbo->fetchArray('SELECT *, (SELECT completato FROM in_statiintervento WHERE idstatointervento=in_interventi.idstatointervento) AS flag_completato, IF((in_interventi.idsede = 0), (SELECT idzona FROM an_anagrafiche WHERE idanagrafica = in_interventi.idanagrafica), (SELECT idzona FROM an_sedi WHERE id = in_interventi.idsede)) AS idzona, (SELECT colore FROM in_statiintervento WHERE idstatointervento=in_interventi.idstatointervento) AS colore, (SELECT idcontratto FROM co_contratti_promemoria WHERE idintervento=in_interventi.id LIMIT 0,1) AS idcontratto, (SELECT idpreventivo FROM co_preventivi_interventi WHERE idintervento=in_interventi.id LIMIT 0,1) AS idpreventivo FROM in_interventi WHERE id='.prepare($id_record).Modules::getAdditionalsQuery($id_module));
}
$jscript_modules[] = $rootdir.'/modules/interventi/js/interventi_helperjs.js';