Skip to content

Commit 65c39fa

Browse files
committed
feat: visualizzazione nome e indirizzo sede in stampa riepilogo interventi
1 parent 72d70e2 commit 65c39fa

3 files changed

Lines changed: 36 additions & 15 deletions

File tree

templates/interventi/body.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@
3737
3838
<table class="table border-bottom">
3939
<tr>
40-
<th colspan="6" class="text-center bg-gray"><h4>'.tr('Cliente', [], ['upper' => true]).'</h4></th>
40+
<th colspan="4" class="text-center bg-gray"><h4>'.tr('Cliente', [], ['upper' => true]).'</h4></th>
4141
</tr>
4242
<tr>
43-
<td width="80">
43+
<td width="100">
4444
<p class="text-muted">'.tr('Cliente', [], ['upper' => true]).':</p>
4545
</td>
46-
<td width="150">
47-
'.$c_ragionesociale.'
46+
<td width="180">
47+
'.$c_ragionesociale.($s_nomesede ? ' ('.$s_nomesede.')' : '').'
4848
</td>';
4949
// Indirizzo
5050
if (!empty($s_indirizzo) or !empty($s_cap) or !empty($s_citta) or !empty($s_provincia)) {
5151
echo '
5252
53-
<td width="110">
53+
<td width="100">
5454
<p class="text-muted">'.tr('Indirizzo', [], ['upper' => true]).':</p>
5555
</td>
56-
<td>
56+
<td width="180">
5757
'.$s_indirizzo.' '.$s_cap.' - '.$s_citta.' ('.strtoupper((string) $s_provincia).')
5858
</td>';
5959
} elseif (!empty($c_indirizzo) or !empty($c_cap) or !empty($c_citta) or !empty($c_provincia)) {
@@ -70,31 +70,31 @@
7070
</tr>
7171
7272
<tr>
73-
<td>
73+
<td width="100">
7474
<p class="text-muted">'.tr('P.Iva', [], ['upper' => true]).':</p>
7575
</td>
76-
<td>
76+
<td width="180">
7777
'.strtoupper((string) $c_piva).'
7878
</td>
79-
<td>
79+
<td width="100">
8080
<p class="text-muted">'.tr('C.F.', [], ['upper' => true]).':</p>
8181
</td>
82-
<td >
82+
<td width="180">
8383
'.strtoupper((string) $c_codicefiscale).'
8484
</td>
8585
</tr>
8686
8787
<tr>
88-
<td>
88+
<td width="100">
8989
<p class="text-muted">'.tr('Telefono', [], ['upper' => true]).':</p>
9090
</td>
91-
<td>
91+
<td width="180">
9292
'.$c_telefono.'
9393
</td>
94-
<td>
94+
<td width="100">
9595
<p class="text-muted">'.tr('Cellulare', [], ['upper' => true]).':</p>
9696
</td>
97-
<td>
97+
<td width="180">
9898
'.$c_cellulare.'
9999
</td>
100100
</tr>

templates/interventi/init.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
if (!empty($documento['idsede_destinazione'])) {
3434
$sedi = $dbo->fetchOne('SELECT nomesede, cap, citta, indirizzo, provincia FROM an_sedi WHERE id = '.prepare($documento['idsede_destinazione']));
3535

36+
$s_nomesede = $sedi['nomesede'];
3637
$s_citta = $sedi['citta'];
3738
$s_indirizzo = $sedi['indirizzo'];
3839
$s_cap = $sedi['cap'];

templates/riepilogo_interventi/piece.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@
3030
$sessioni = $intervento->sessioni;
3131
$iva_predefinita = floatval(Aliquota::find(setting('Iva predefinita'))->percentuale);
3232

33+
if (!empty($intervento['idsede_destinazione'])) {
34+
$sedi = $dbo->fetchOne('SELECT nomesede, cap, citta, indirizzo, provincia FROM an_sedi WHERE id = '.prepare($intervento['idsede_destinazione']));
35+
36+
$nomesede = $sedi['nomesede'];
37+
$citta = $sedi['citta'];
38+
$indirizzo = $sedi['indirizzo'];
39+
$cap = $sedi['cap'];
40+
$provincia = $sedi['provincia'];
41+
} else {
42+
$sedi = $dbo->fetchOne('SELECT cap, citta, indirizzo, provincia FROM an_anagrafiche WHERE idanagrafica = '.prepare($intervento['idanagrafica']));
43+
44+
$citta = $sedi['citta'];
45+
$indirizzo = $sedi['indirizzo'];
46+
$cap = $sedi['cap'];
47+
$provincia = $sedi['provincia'];
48+
49+
}
50+
3351
$km = $sessioni->sum('km');
3452
$ore = $sessioni->sum('ore');
3553
$imponibile = $tipo == 'interno' ? $intervento->spesa : $intervento->imponibile;
@@ -65,8 +83,10 @@
6583
'_NUM_' => $intervento->codice,
6684
]).'</p>';
6785
}
86+
6887
echo '
69-
<p><small><b>'.tr('Cliente').':</b> '.$intervento->anagrafica->ragione_sociale.'</small></p>
88+
<p><small><b>'.tr('Cliente').':</b> '.$intervento->anagrafica->ragione_sociale.($nomesede ? ' ('.$nomesede.')' : '').'</small></p>
89+
<p><small><b>'.tr('Indirizzo').':</b> '.$indirizzo.' '.$cap.' - '.$citta.' ('.strtoupper((string) $provincia).')</small></p>
7090
<p><small><b>'.tr('Stato').':</b> '.$intervento->stato->getTranslation('title').'</small></p>
7191
<p><small><b>'.tr('Data richiesta').':</b> '.dateFormat($intervento->data_richiesta).'</small></p>
7292
<p><small><b>'.tr('Richiesta').':</b> '.strip_tags($intervento->richiesta).'</p>';

0 commit comments

Comments
 (0)