openstamanager/templates/ddt/footer.php

211 lines
5.2 KiB
PHP
Raw Normal View History

2017-09-08 17:03:47 +02:00
<?php
2020-09-07 15:04:06 +02:00
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
2021-01-20 15:08:51 +01:00
* Copyright (C) DevCode s.r.l.
2020-09-07 15:04:06 +02:00
*
* 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-09-08 17:03:47 +02:00
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 = $documento->volume ?: $documento->volume_calcolato;
$peso_lordo = $documento->peso ?: $documento->peso_calcolato;
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'>
".moneyFormat($totale_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$';
}