1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-11 07:56:16 +01:00
openstamanager/templates/ddt/footer.php

245 lines
6.5 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
2024-05-23 16:05:30 +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;
$sconto_finale = $documento->getScontoFinale();
$netto_a_pagare = $documento->netto;
2019-07-12 12:40:13 +02:00
$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 '
2024-05-23 16:05:30 +02:00
<table class="table table-striped 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>
<td rowspan='10'>
2024-05-23 16:05:30 +02:00
<p class='small-bold text-muted'>".tr('Note', [], ['upper' => true]).'</p>
2024-05-23 11:36:25 +02:00
<p>'.nl2br((string) $documento['note'])."</p>
2017-09-08 17:03:47 +02:00
</td>
2017-09-08 18:19:39 +02:00
<td style='width:33mm;'>
2024-05-23 16:05:30 +02:00
<p class='small-bold text-muted'>".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, $d_totali).'
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;'>
2024-05-23 16:05:30 +02:00
<p class='small-bold text-muted'>".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'>
".moneyFormat($totale_iva, $d_totali).'
2017-09-08 17:03:47 +02:00
</td>
</tr>';
// Riga 3
echo "
<tr>
2017-09-08 18:19:39 +02:00
<td>
2024-05-23 16:05:30 +02:00
<p class='small-bold text-muted'>".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'>
".moneyFormat($totale, $d_totali).'
2017-09-08 17:03:47 +02:00
</td>
</tr>';
if ($sconto_finale) {
// Riga 4 SCONTO IN FATTURA
echo "
<tr>
<td>
2024-05-23 16:05:30 +02:00
<p class='small-bold text-muted'>".tr('Sconto in fattura', [], ['upper' => true])."</p>
</td>
</tr>
<tr>
<td class='cell-padded text-right'>
".moneyFormat($sconto_finale, $d_totali).'
</td>
</tr>';
// Riga 5 NETTO A PAGARE
echo "
<tr>
<td>
2024-05-23 16:05:30 +02:00
<p class='small-bold text-muted'>".tr('Netto a pagare', [], ['upper' => true])."</p>
</td>
</tr>
<tr>
<td class='cell-padded text-right'>
".moneyFormat($netto_a_pagare, $d_totali).'
</td>
</tr>';
}
2017-09-08 17:03:47 +02:00
} else {
// Riga 1
echo "
<tr>
<td style='height:40mm;'>
2024-05-23 16:05:30 +02:00
<p class='small-bold text-muted'>".tr('Note', [], ['upper' => true]).'</p>
2024-05-23 11:36:25 +02:00
'.nl2br((string) $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 '
2024-05-23 16:05:30 +02:00
<table class="table table-striped border-bottom">
2017-09-08 17:03:47 +02:00
<tr>
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted" class style="width:25%;">
'.tr('Aspetto beni', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted" class style="width:20%">
'.tr('Num. colli', [], ['upper' => true]).'
</th>
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted" class style="width:20%">
'.tr('Data ora trasporto', [], ['upper' => true]).'
</th>
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted" style="width:30%">
'.tr('Causale trasporto', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted" 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">
2024-05-14 14:30:16 +02:00
'.(!empty($documento['data_ora_trasporto']) ? 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>
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted">
'.tr('Peso lordo', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted">
2018-09-24 11:24:48 +02:00
'.tr('Volume', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted">
'.tr('Vettore', [], ['upper' => true]).'
2017-09-08 17:03:47 +02:00
</th>
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted" 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
2023-05-18 16:11:27 +02:00
if ($documento->direzione == 'entrata') {
echo '
<table class="table-bordered">
<tr>
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted" style="width:33%">
2023-05-18 16:11:27 +02:00
'.tr('Firma conducente', [], ['upper' => true]).'
</th>
2017-09-08 17:03:47 +02:00
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted" style="width:33%">
2023-05-18 16:11:27 +02:00
'.tr('Firma vettore', [], ['upper' => true]).'
</th>
2017-09-08 17:03:47 +02:00
2024-05-23 16:05:30 +02:00
<th class="small-bold text-muted" style="width:33%">
2023-05-18 16:11:27 +02:00
'.tr('Firma destinatario', [], ['upper' => true]).'
</th>
</tr>
2017-09-08 17:03:47 +02:00
2023-05-18 16:11:27 +02:00
<tr>
<td style="height: 10mm"></td>
<td style="height: 10mm"></td>
<td style="height: 10mm"></td>
</tr>
</table>';
}
2017-09-08 17:03:47 +02:00
if (empty($options['last-page-footer'])) {
echo '$default_footer$';
}