2017-08-04 16:28:16 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include_once __DIR__.'/../../core.php';
|
2017-09-06 15:29:51 +02:00
|
|
|
include_once __DIR__.'/modutil.php';
|
2017-08-04 16:28:16 +02:00
|
|
|
|
2017-08-07 13:07:18 +02:00
|
|
|
if (Auth::admin() || $_SESSION['gruppo'] != 'Tecnici') {
|
2017-09-06 15:29:51 +02:00
|
|
|
$costi = get_costi_intervento($id_record);
|
2017-08-04 16:28:16 +02:00
|
|
|
|
|
|
|
echo '
|
|
|
|
<!-- Riepilogo dei costi -->
|
|
|
|
<table class="table table condensed table-striped table-hover table-bordered">
|
|
|
|
<tr>
|
|
|
|
<th width="40%"></th>
|
2017-09-10 14:35:41 +02:00
|
|
|
<th width="20%" class="text-center">'.tr('Costo', [], ['upper' => true]).'</th>
|
|
|
|
<th width="20%" class="text-center">'.tr('Addebito', [], ['upper' => true]).'</th>
|
|
|
|
<th width="20%" class="text-center">'.tr('Tot. Scontato', [], ['upper' => true]).'</th>
|
2017-08-04 16:28:16 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2017-09-10 14:35:41 +02:00
|
|
|
<th>'.tr('Totale manodopera', [], ['upper' => true]).'</th>
|
2017-09-06 15:29:51 +02:00
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['manodopera_costo']).' €</td>
|
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['manodopera_addebito']).' €</td>
|
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['manodopera_scontato']).' €</td>
|
2017-08-04 16:28:16 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2017-09-10 14:35:41 +02:00
|
|
|
<th>'.tr('Totale viaggio', [], ['upper' => true]).'</th>
|
2017-09-06 15:29:51 +02:00
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['viaggio_costo']).' €</td>
|
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['viaggio_addebito']).' €</td>
|
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['viaggio_scontato']).' €</td>
|
2017-08-04 16:28:16 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2017-09-10 14:35:41 +02:00
|
|
|
<th>'.tr('Totale articoli', [], ['upper' => true]).'</th>
|
2017-09-06 15:29:51 +02:00
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['ricambi_costo']).' €</td>
|
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['ricambi_addebito']).' €</td>
|
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['ricambi_scontato']).' €</td>
|
2017-08-04 16:28:16 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2017-09-10 14:35:41 +02:00
|
|
|
<th>'.tr('Totale altre spese', [], ['upper' => true]).'</th>
|
2017-09-06 15:29:51 +02:00
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['altro_costo']).' €</td>
|
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['altro_addebito']).' €</td>
|
|
|
|
<td class="text-right">'.Translator::numberToLocale($costi['altro_scontato']).' €</td>
|
2017-08-04 16:28:16 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2017-09-10 14:35:41 +02:00
|
|
|
<th>'.tr('Sconto totale', [], ['upper' => true]).'</th>
|
2017-08-04 16:28:16 +02:00
|
|
|
<td class="text-right">-</td>
|
|
|
|
<td class="text-right">-</td>
|
2017-09-06 15:29:51 +02:00
|
|
|
<td class="text-right">'.Translator::numberToLocale(-$costi['sconto_globale']).' €</td>
|
2017-08-04 16:28:16 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2017-09-10 14:35:41 +02:00
|
|
|
<th>'.tr('Totale', [], ['upper' => true]).'</th>
|
2017-09-14 17:37:32 +02:00
|
|
|
<th class="text-right">'.Translator::numberToLocale($costi['totale_costo']).' €</th>
|
2017-09-06 15:29:51 +02:00
|
|
|
<th class="text-right">'.Translator::numberToLocale($costi['totale_addebito']).' €</th>
|
2017-09-11 13:08:50 +02:00
|
|
|
<th class="text-right">'.Translator::numberToLocale($costi['totale']).' €</th>
|
2017-08-04 16:28:16 +02:00
|
|
|
</tr>
|
|
|
|
</table>';
|
|
|
|
}
|
|
|
|
|
2017-09-06 15:29:51 +02:00
|
|
|
// Lettura dello sconto globale
|
|
|
|
$rss = $dbo->fetchArray('SELECT sconto_globale, tipo_sconto_globale FROM in_interventi WHERE id='.prepare($id_record));
|
|
|
|
$sconto = $rss[0]['sconto_globale'];
|
|
|
|
$tipo_sconto = $rss[0]['tipo_sconto_globale'];
|
|
|
|
|
2017-08-04 16:28:16 +02:00
|
|
|
echo '
|
|
|
|
|
2017-09-06 15:29:51 +02:00
|
|
|
<!-- SCONTO -->
|
2017-08-04 16:28:16 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-4 pull-right">
|
2017-09-04 12:02:29 +02:00
|
|
|
{[ "type": "number", "label": "'.tr('Sconto globale').'", "name": "sconto_globale", "value": "'.$sconto.'", "icon-after": "choice|untprc|'.$tipo_sconto.'" ]}
|
2017-08-04 16:28:16 +02:00
|
|
|
</div>
|
|
|
|
</div>';
|
2017-09-11 11:28:39 +02:00
|
|
|
|
|
|
|
echo '
|
|
|
|
<script src="'.$rootdir.'/lib/init.js"></script>';
|