2017-08-04 16:28:16 +02:00
|
|
|
<?php
|
2020-09-07 15:04:06 +02:00
|
|
|
/*
|
|
|
|
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
|
|
|
* Copyright (C) DevCode s.n.c.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
include_once __DIR__.'/../../core.php';
|
|
|
|
|
2019-07-12 17:35:14 +02:00
|
|
|
use Modules\Interventi\Intervento;
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2019-07-12 17:35:14 +02:00
|
|
|
$documento = Intervento::find($id_record);
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2020-11-09 19:19:55 +01:00
|
|
|
$preventivo = $dbo->fetchOne('SELECT numero, data_bozza FROM co_preventivi WHERE id = '.prepare($documento['id_preventivo']));
|
|
|
|
$contratto = $dbo->fetchOne('SELECT nome, numero, data_bozza FROM co_contratti WHERE id = '.prepare($documento['id_contratto']));
|
2017-09-11 13:08:50 +02:00
|
|
|
|
2019-07-12 17:35:14 +02:00
|
|
|
$id_cliente = $documento['idanagrafica'];
|
|
|
|
$id_sede = $documento['idsede'];
|
2020-01-08 12:27:25 +01:00
|
|
|
|
2020-01-17 17:31:46 +01:00
|
|
|
if (!empty($documento['idsede_destinazione'])) {
|
2020-01-15 19:37:36 +01:00
|
|
|
$sedi = $dbo->fetchOne('SELECT nomesede, cap, citta, indirizzo, provincia FROM an_sedi WHERE id = '.prepare($documento['idsede_destinazione']));
|
|
|
|
|
|
|
|
$s_citta = $sedi['citta'];
|
|
|
|
$s_indirizzo = $sedi['indirizzo'];
|
|
|
|
$s_cap = $sedi['cap'];
|
|
|
|
$s_provincia = $sedi['provincia'];
|
|
|
|
}
|
|
|
|
|
|
|
|
//Se ho deciso di NON mostrare i prezzi al tencico mi assicuro che non li possa vedere dalla stampa
|
2020-01-11 13:36:43 +01:00
|
|
|
if (Auth::user()['gruppo'] == 'Tecnici' and $options['pricing'] == true and setting('Mostra i prezzi al tecnico') == 0) {
|
|
|
|
$options['pricing'] = false;
|
|
|
|
}
|