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
|
|
|
|
2019-07-29 16:54:20 +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;
|
2021-04-06 15:44:51 +02:00
|
|
|
$sconto_finale = $documento->getScontoFinale();
|
|
|
|
$netto_a_pagare = $documento->netto;
|
2019-07-12 12:40:13 +02:00
|
|
|
|
2020-07-08 08:45:55 +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 '
|
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>
|
2021-04-06 15:44:51 +02:00
|
|
|
<td rowspan='10'>
|
2017-09-10 14:35:41 +02:00
|
|
|
<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;'>
|
2017-09-10 14:35:41 +02:00
|
|
|
<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'>
|
2023-12-06 10:06:36 +01:00
|
|
|
".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;'>
|
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'>
|
2023-12-06 10:06:36 +01:00
|
|
|
".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>
|
2017-09-10 14:35:41 +02:00
|
|
|
<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'>
|
2023-12-06 10:06:36 +01:00
|
|
|
".moneyFormat($totale, $d_totali).'
|
2017-09-08 17:03:47 +02:00
|
|
|
</td>
|
|
|
|
</tr>';
|
2021-04-06 15:44:51 +02:00
|
|
|
|
2021-04-12 15:51:27 +02:00
|
|
|
if ($sconto_finale) {
|
2022-01-15 17:30:49 +01:00
|
|
|
// Riga 4 SCONTO IN FATTURA
|
2021-04-06 15:44:51 +02:00
|
|
|
echo "
|
|
|
|
<tr>
|
|
|
|
<td>
|
2022-01-15 17:30:49 +01:00
|
|
|
<p class='small-bold'>".tr('Sconto in fattura', [], ['upper' => true])."</p>
|
2021-04-06 15:44:51 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class='cell-padded text-right'>
|
2023-12-06 10:06:36 +01:00
|
|
|
".moneyFormat($sconto_finale, $d_totali).'
|
2021-04-06 15:44:51 +02:00
|
|
|
</td>
|
2021-04-12 15:51:27 +02:00
|
|
|
</tr>';
|
2021-04-06 15:44:51 +02:00
|
|
|
|
|
|
|
// Riga 5 NETTO A PAGARE
|
|
|
|
echo "
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<p class='small-bold'>".tr('Netto a pagare', [], ['upper' => true])."</p>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class='cell-padded text-right'>
|
2023-12-06 10:06:36 +01:00
|
|
|
".moneyFormat($netto_a_pagare, $d_totali).'
|
2021-04-06 15:44:51 +02:00
|
|
|
</td>
|
2021-04-12 15:51:27 +02:00
|
|
|
</tr>';
|
2021-04-06 15:44:51 +02:00
|
|
|
}
|
2017-09-08 17:03:47 +02:00
|
|
|
} else {
|
|
|
|
// Riga 1
|
|
|
|
echo "
|
|
|
|
<tr>
|
|
|
|
<td style='height:40mm;'>
|
2017-09-10 14:35:41 +02:00
|
|
|
<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>';
|
|
|
|
|
2017-09-13 11:15:31 +02:00
|
|
|
// 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>
|
2020-05-29 16:32:00 +02:00
|
|
|
<th class="small" class style="width:25%;">
|
2017-09-10 14:35:41 +02:00
|
|
|
'.tr('Aspetto beni', [], ['upper' => true]).'
|
2017-09-08 17:03:47 +02:00
|
|
|
</th>
|
|
|
|
|
2017-09-13 11:15:31 +02:00
|
|
|
<th class="small" class style="width:20%">
|
2017-09-14 10:27:49 +02:00
|
|
|
'.tr('Num. colli', [], ['upper' => true]).'
|
2017-09-13 11:15:31 +02:00
|
|
|
</th>
|
|
|
|
|
2020-01-14 18:31:46 +01:00
|
|
|
<th class="small" class style="width:20%">
|
|
|
|
'.tr('Data ora trasporto', [], ['upper' => true]).'
|
|
|
|
</th>
|
|
|
|
|
2017-09-13 11:15:31 +02:00
|
|
|
<th class="small" style="width:30%">
|
2017-09-12 16:17:11 +02:00
|
|
|
'.tr('Causale trasporto', [], ['upper' => true]).'
|
2017-09-08 17:03:47 +02:00
|
|
|
</th>
|
|
|
|
|
2017-09-13 11:15:31 +02:00
|
|
|
<th class="small" style="width:25%">
|
2017-09-12 16:17:11 +02:00
|
|
|
'.tr('Porto', [], ['upper' => true]).'
|
2017-09-08 17:03:47 +02:00
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2017-09-13 11:15:31 +02:00
|
|
|
<td class="cell-padded">
|
2017-09-08 17:03:47 +02:00
|
|
|
$aspettobeni$
|
|
|
|
</td>
|
2017-09-13 11:15:31 +02:00
|
|
|
|
|
|
|
<td class="cell-padded">
|
|
|
|
$n_colli$
|
|
|
|
</td>
|
|
|
|
|
2020-01-14 18:31:46 +01:00
|
|
|
<td class="cell-padded">
|
|
|
|
'.Translator::TimestampToLocale($documento['data_ora_trasporto']).'
|
|
|
|
</td>
|
|
|
|
|
2017-09-13 11:15:31 +02:00
|
|
|
<td class="cell-padded">
|
2017-09-08 17:03:47 +02:00
|
|
|
$causalet$
|
|
|
|
</td>
|
2017-09-13 11:15:31 +02:00
|
|
|
|
2017-09-08 17:03:47 +02:00
|
|
|
<td class="cell-padded">
|
|
|
|
$porto$
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2017-09-13 11:15:31 +02:00
|
|
|
<th class="small">
|
|
|
|
'.tr('Peso lordo', [], ['upper' => true]).'
|
2017-09-08 17:03:47 +02:00
|
|
|
</th>
|
|
|
|
|
2017-09-13 11:15:31 +02:00
|
|
|
<th class="small">
|
2018-09-24 11:24:48 +02:00
|
|
|
'.tr('Volume', [], ['upper' => true]).'
|
2017-09-08 17:03:47 +02:00
|
|
|
</th>
|
|
|
|
|
2017-09-13 11:15:31 +02:00
|
|
|
<th class="small">
|
2017-09-10 14:35:41 +02:00
|
|
|
'.tr('Vettore', [], ['upper' => true]).'
|
2017-09-08 17:03:47 +02:00
|
|
|
</th>
|
2017-09-13 11:15:31 +02:00
|
|
|
|
2020-01-14 18:31:46 +01:00
|
|
|
<th class="small" colspan="2">
|
2017-09-13 11:15:31 +02:00
|
|
|
'.tr('Tipo di spedizione', [], ['upper' => true]).'
|
|
|
|
</th>
|
2017-09-08 17:03:47 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2017-09-13 11:15:31 +02:00
|
|
|
<td class="cell-padded">
|
2019-07-16 10:32:54 +02:00
|
|
|
'.(!empty($peso_lordo) ? Translator::numberToLocale($peso_lordo).' KG' : '').'
|
2017-09-08 17:03:47 +02:00
|
|
|
</td>
|
2017-09-13 11:15:31 +02:00
|
|
|
|
|
|
|
<td class="cell-padded">
|
2019-07-16 10:32:54 +02:00
|
|
|
'.(!empty($volume) ? Translator::numberToLocale($volume).' M<sup>3</sup>' : '').'
|
2017-09-08 17:03:47 +02:00
|
|
|
</td>
|
2017-09-13 11:15:31 +02:00
|
|
|
|
2017-09-08 17:03:47 +02:00
|
|
|
<td class="cell-padded">
|
|
|
|
$vettore$
|
|
|
|
</td>
|
2017-09-13 11:15:31 +02:00
|
|
|
|
2020-01-14 18:31:46 +01:00
|
|
|
<td class="cell-padded" colspan="2">
|
2017-09-13 11:15:31 +02:00
|
|
|
$spedizione$
|
|
|
|
</td>
|
2017-09-08 17:03:47 +02:00
|
|
|
</tr>
|
2017-09-13 11:15:31 +02:00
|
|
|
</table>';
|
2017-09-08 17:03:47 +02:00
|
|
|
|
2017-09-13 11:15:31 +02:00
|
|
|
// Firme
|
2023-05-18 16:11:27 +02:00
|
|
|
if ($documento->direzione == 'entrata') {
|
|
|
|
echo '
|
|
|
|
<table class="table-bordered">
|
|
|
|
<tr>
|
|
|
|
<th class="small" style="width:33%">
|
|
|
|
'.tr('Firma conducente', [], ['upper' => true]).'
|
|
|
|
</th>
|
2017-09-08 17:03:47 +02:00
|
|
|
|
2023-05-18 16:11:27 +02:00
|
|
|
<th class="small" style="width:33%">
|
|
|
|
'.tr('Firma vettore', [], ['upper' => true]).'
|
|
|
|
</th>
|
2017-09-08 17:03:47 +02:00
|
|
|
|
2023-05-18 16:11:27 +02:00
|
|
|
<th class="small" style="width:33%">
|
|
|
|
'.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
|
|
|
|
2019-07-29 16:54:20 +02:00
|
|
|
if (empty($options['last-page-footer'])) {
|
|
|
|
echo '$default_footer$';
|
|
|
|
}
|