mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-16 19:40:44 +01:00
Fix idsede_destinazione in fase di aggiunta sessione tecnico
This commit is contained in:
parent
4de7ec4717
commit
acfdcf58f3
@ -23,7 +23,11 @@ echo '
|
||||
|
||||
// Tecnico
|
||||
echo '
|
||||
<p>'.tr('Tecnico').': '.$sessione['ragione_sociale'].' '.(!empty($sessione['deleted_at']) ? '<small class="text-danger"><em>('.tr('Eliminato').')</em></small>' : '').'</p>';
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{[ "type": "span", "label": "'.tr('Tecnico').'", "name": "tecnico", "required": 0, "value": "'.$sessione['ragione_sociale'].' '.(!empty($sessione['deleted_at']) ? '<small class="text-danger"><em>('.tr('Eliminato').')</em></small>' : '').'" ]}
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
// Orari
|
||||
echo '
|
||||
|
@ -60,26 +60,26 @@ function add_tecnico($idintervento, $idtecnico, $inizio, $fine, $idcontratto = n
|
||||
return false;
|
||||
}
|
||||
|
||||
$rs = $dbo->fetchArray('SELECT idanagrafica, idsede, idtipointervento FROM in_interventi WHERE id='.prepare($idintervento));
|
||||
$rs = $dbo->fetchArray('SELECT idanagrafica, idsede_destinazione, idtipointervento FROM in_interventi WHERE id='.prepare($idintervento));
|
||||
$idanagrafica = $rs[0]['idanagrafica'];
|
||||
$idsede = $rs[0]['idsede'];
|
||||
$idsede_destinazione = $rs[0]['idsede_destinazione'];
|
||||
$idtipointervento = $rs[0]['idtipointervento'];
|
||||
|
||||
// Calcolo km in base a quelli impostati nell'anagrafica
|
||||
// Nessuna sede
|
||||
if ($idsede == '-1') {
|
||||
if ($idsede_destinazione == '-1') {
|
||||
$km = 0;
|
||||
}
|
||||
|
||||
// Sede legale
|
||||
elseif (empty($idsede)) {
|
||||
elseif (empty($idsede_destinazione)) {
|
||||
$rs2 = $dbo->fetchArray('SELECT km FROM an_anagrafiche WHERE idanagrafica='.prepare($idanagrafica));
|
||||
$km = $rs2[0]['km'];
|
||||
}
|
||||
|
||||
// Sede secondaria
|
||||
else {
|
||||
$rs2 = $dbo->fetchArray('SELECT km FROM an_sedi WHERE id='.prepare($idsede));
|
||||
$rs2 = $dbo->fetchArray('SELECT km FROM an_sedi WHERE id='.prepare($idsede_destinazione));
|
||||
$km = $rs2[0]['km'];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user