openstamanager/templates/ddt/footer.php

198 lines
4.5 KiB
PHP
Raw Normal View History

2017-09-08 17:03:47 +02:00
<?php
if (!empty($options['last-page-footer']) && !$is_last_page) {
return;
}
2019-07-12 12:40:13 +02:00
// Calcoli
$imponibile = $documento->imponibile;
$sconto = $documento->sconto;
$totale_imponibile = $documento->totale_imponibile;
$totale_iva = $documento->iva;
$totale = $documento->totale;
$volume = $righe->sum(function ($item) {
return $item->isArticolo() ? $item->articolo->volume*$item->qta : 0;
2019-07-12 12:40:13 +02:00
});
$peso_lordo = $righe->sum(function ($item) {
return $item->isArticolo() ? $item->articolo->peso_lordo*$item->qta : 0;
2019-07-12 12:40:13 +02:00
});
2017-09-08 17:03:47 +02:00
// TABELLA PRINCIPALE
echo '
2017-09-08 18:19:39 +02:00
<table class="table-bordered">';
2017-09-08 17:03:47 +02:00
2017-09-21 15:51:39 +02:00
if ($options['pricing']) {
2017-09-08 17:03:47 +02:00
// Riga 1
echo "
<tr>
2017-09-08 18:19:39 +02:00
<td rowspan='7'>
<p class='small-bold'>".tr('Note', [], ['upper' => true]).'</p>
2019-07-12 12:40:13 +02:00
<p>'.nl2br($documento['note'])."</p>
2017-09-08 17:03:47 +02:00
</td>
2017-09-08 18:19:39 +02:00
<td style='width:33mm;'>
<p class='small-bold'>".tr('Totale imponibile', [], ['upper' => true]).'</p>
2017-09-08 17:03:47 +02:00
</td>
</tr>';
// Dati riga 1
echo "
<tr>
2017-09-08 18:19:39 +02:00
<td class='cell-padded text-right'>
2019-05-02 10:03:57 +02:00
".moneyFormat($imponibile, 2).'
2017-09-08 17:03:47 +02:00
</td>
</tr>';
// Riga 2
echo "
<tr>
2017-09-08 18:19:39 +02:00
<td style='width:33mm;'>
2019-07-12 12:40:13 +02:00
<p class='small-bold'>".tr('Totale IVA', [], ['upper' => true])."</p>
2017-09-08 17:03:47 +02:00
</td>
</tr>
<tr>
2017-09-08 18:19:39 +02:00
<td class='cell-padded text-right'>
2019-07-12 12:40:13 +02:00
".moneyFormat($totale_iva, 2).'
2017-09-08 17:03:47 +02:00
</td>
</tr>';
// Riga 3
echo "
<tr>
2017-09-08 18:19:39 +02:00
<td>
<p class='small-bold'>".tr('Totale documento', [], ['upper' => true])."</p>
2017-09-08 17:03:47 +02:00
</td>
</tr>
<tr>
2017-09-08 18:19:39 +02:00
<td class='cell-padded text-right'>
2019-05-02 10:03:57 +02:00
".moneyFormat($totale, 2).'
2017-09-08 17:03:47 +02:00
</td>
</tr>';
} else {
// Riga 1
echo "
<tr>
<td style='height:40mm;'>
<p class='small-bold'>".tr('Note', [], ['upper' => true]).'</p>
2019-07-12 12:40:13 +02:00
'.nl2br($documento['note']).'
2017-09-08 17:03:47 +02:00
</td>
</tr>';
}
echo '
</table>';
// Informazioni aggiuntive
2017-09-08 17:03:47 +02:00
echo '
2017-09-08 18:19:39 +02:00
<table class="table-bordered">
2017-09-08 17:03:47 +02:00
<tr>
<th class="small" class style="width:25%">
'.tr('Aspetto beni', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
<th class="small" class style="width:20%">
'.tr('Num. colli', [], ['upper' => true]).'
</th>
<th class="small" class style="width:20%">
'.tr('Data ora trasporto', [], ['upper' => true]).'
</th>
<th class="small" style="width:30%">
'.tr('Causale trasporto', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
<th class="small" style="width:25%">
'.tr('Porto', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
</tr>
<tr>
<td class="cell-padded">
2017-09-08 17:03:47 +02:00
$aspettobeni$ &nbsp;
</td>
<td class="cell-padded">
$n_colli$ &nbsp;
</td>
<td class="cell-padded">
'.Translator::TimestampToLocale($documento['data_ora_trasporto']).' &nbsp;
</td>
<td class="cell-padded">
2017-09-08 17:03:47 +02:00
$causalet$ &nbsp;
</td>
2017-09-08 17:03:47 +02:00
<td class="cell-padded">
$porto$ &nbsp;
</td>
</tr>
<tr>
<th class="small">
'.tr('Peso lordo', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
<th class="small">
2018-09-24 11:24:48 +02:00
'.tr('Volume', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
<th class="small">
'.tr('Vettore', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
<th class="small" colspan="2">
'.tr('Tipo di spedizione', [], ['upper' => true]).'
</th>
2017-09-08 17:03:47 +02:00
</tr>
<tr>
<td class="cell-padded">
2019-07-16 10:32:54 +02:00
'.(!empty($peso_lordo) ? Translator::numberToLocale($peso_lordo).'&nbsp;KG' : '').'
2017-09-08 17:03:47 +02:00
</td>
<td class="cell-padded">
2019-07-16 10:32:54 +02:00
'.(!empty($volume) ? Translator::numberToLocale($volume).'&nbsp;M<sup>3</sup>' : '').'
2017-09-08 17:03:47 +02:00
</td>
2017-09-08 17:03:47 +02:00
<td class="cell-padded">
$vettore$ &nbsp;
</td>
<td class="cell-padded" colspan="2">
$spedizione$ &nbsp;
</td>
2017-09-08 17:03:47 +02:00
</tr>
</table>';
2017-09-08 17:03:47 +02:00
// Firme
echo '
<table class="table-bordered">
2017-09-08 17:03:47 +02:00
<tr>
<th class="small" style="width:33%">
'.tr('Firma conducente', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
<th class="small" style="width:33%">
'.tr('Firma vettore', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
<th class="small" style="width:33%">
'.tr('Firma destinatario', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
</tr>
<tr>
<td style="height: 10mm"></td>
<td style="height: 10mm"></td>
<td style="height: 10mm"></td>
2017-09-08 17:03:47 +02:00
</tr>
</table>';
if (empty($options['last-page-footer'])) {
echo '$default_footer$';
}