Aggiunta colonna KM in stampa riepilogo Attività

This commit is contained in:
Pek5892 2023-02-13 09:37:38 +01:00
parent 1cd4abc2d5
commit 323fa115c4
3 changed files with 11 additions and 7 deletions

View File

@ -38,6 +38,7 @@ echo '
<th class="text-right" style="border-left: 0;">
<b>'.tr('Totale', [], ['upper' => true]).':</b>
</th>
<th class="text-center">'.($km).'</td>
<th class="text-center">'.($pricing ? $somma_ore : '-').'</th>
<th class="text-center">'.($pricing ? moneyFormat($somma_imponibile, 2) : '-').'</th>
<th class="text-center">'.($pricing ? moneyFormat($somma_sconto, 2) : '-').'</th>
@ -49,7 +50,7 @@ echo '
<th class="text-right" style="border-left: 0;">
<b>'.tr('Iva', [], ['upper' => true]).':</b>
</th>
<th colspan="3"></th>
<th colspan="4"></th>
<th class="text-center">'.($pricing ? moneyFormat($somma_iva, 2) : '-').'</th>
</tr>
@ -58,7 +59,7 @@ echo '
<th class="text-right" style="border-left: 0;">
<b>'.tr('Totale Ivato', [], ['upper' => true]).':</b>
</th>
<th colspan="3"></th>
<th colspan="4"></th>
<th class="text-center">'.($pricing ? moneyFormat($somma_totale_ivato, 2) : '-').'</th>
</tr>
</tbody>

View File

@ -26,6 +26,7 @@ $intervento = Intervento::find($record['id']);
$sessioni = $intervento->sessioni;
$iva_predefinita = floatval(Aliquota::find(setting('Iva predefinita'))->percentuale);
$km = $sessioni->sum('km');
$ore = $sessioni->sum('ore');
$imponibile = $tipo=='interno' ? $intervento->spesa : $intervento->imponibile;
$sconto = $tipo=='interno' ? 0 : $intervento->sconto;
@ -76,6 +77,7 @@ echo '
}
echo '
</td>
<td class="text-center">'.($km).'</td>
<td class="text-center">'.($pricing ? $ore : '-').'</td>
<td class="text-center">'.($pricing ? moneyFormat($imponibile, 2) : '-').'</td>
<td class="text-center">'.($pricing && empty($options['dir']) ? moneyFormat($sconto, 2) : '-').'</td>
@ -87,7 +89,7 @@ if (count($sessioni) > 0) {
echo '
<tr>
<td style="border-top: 0; border-bottom: 0;"></td>
<th style="background-color: #eee" colspan="2"><small>'.tr('Sessioni').'</small></th>
<th style="background-color: #eee" colspan="3"><small>'.tr('Sessioni').'</small></th>
<th class="text-center" style="background-color: #eee"><small>'.tr('Data').'</small></th>
<th class="text-center" style="background-color: #eee"><small>'.tr('Inizio').'</small></th>
<th class="text-center" style="background-color: #eee"><small>'.tr('Fine').'</small></th>
@ -97,7 +99,7 @@ if (count($sessioni) > 0) {
echo '
<tr>
<td style="border-top: 0; border-bottom: 0;"></td>
<td colspan="2"><small>'.$sessione->anagrafica->ragione_sociale.' <small>('.$sessione->tipo->descrizione.')</small></td>
<td colspan="3"><small>'.$sessione->anagrafica->ragione_sociale.' <small>('.$sessione->tipo->descrizione.')</small></td>
<td class="text-center"><small>'.dateFormat($sessione->orario_inizio).'</small></td>
<td class="text-center"><small>'.timeFormat($sessione->orario_inizio).'</small></td>
<td class="text-center"><small>'.timeFormat($sessione->orario_fine).'</small></td>
@ -111,7 +113,7 @@ if (!$righe->isEmpty()) {
echo '
<tr>
<td style="border-top: 0; border-bottom: 0;"></td>
<th style="background-color: #eee" colspan="2"><small>'.tr('Materiale utilizzato e spese aggiuntive').'</small></th>
<th style="background-color: #eee" colspan="3"><small>'.tr('Materiale utilizzato e spese aggiuntive').'</small></th>
<th class="text-center" style="background-color: #eee"><small>'.tr('Qta').'</small></th>
<th class="text-center" style="background-color: #eee"><small>'.($tipo=='interno' ? tr('Costo unitario') : tr('Prezzo unitario')).'</small></th>
<th class="text-center" style="background-color: #eee"><small>'.($tipo=='interno' ? tr('Costo netto') : tr('Imponibile')).'</small></th>
@ -124,7 +126,7 @@ if (!$righe->isEmpty()) {
echo '
<tr>
<td style="border-top: 0; border-bottom: 0;"></td>
<td colspan="2"><small>'.$riga->descrizione.'</small></td>
<td colspan="3"><small>'.$riga->descrizione.'</small></td>
<td class="text-center"><small>'.$riga->qta.' '.$riga->um.'</small></td>
<td class="text-center"><small>'.($pricing ? moneyFormat($prezzo) : '-').'</small></td>
<td class="text-center"><small>'.($pricing ? moneyFormat($totale) : '-').'</small></td>

View File

@ -28,7 +28,8 @@ echo '
<thead>
<tr>
<th colspan="2"><small>'.tr('Documento', [], ['upper' => true]).'</small></th>
<th class="text-center" style="width:10%"><small>'.tr('Ore', [], ['upper' => true]).'</small></th>
<th class="text-center" style="width:8%"><small>'.tr('KM', [], ['upper' => true]).'</small></th>
<th class="text-center" style="width:8%"><small>'.tr('Ore', [], ['upper' => true]).'</small></th>
<th class="text-center" style="width:15%"><small>'.($tipo=='interno' ? tr('Costo totale', [], ['upper' => true]) : tr('Imponibile', [], ['upper' => true])).'</th>
<th class="text-center" style="width:15%"><small>'.tr('Sconto', [], ['upper' => true]).'</small></th>
<th class="text-center" style="width:15%"><small>'.($tipo=='interno' ? tr('Costo netto', [], ['upper' => true]) : tr('Totale imponibile', [], ['upper' => true])).'</small></th>