2017-09-12 17:46:19 +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-12 17:46:19 +02:00
|
|
|
|
|
|
|
include_once __DIR__.'/../../core.php';
|
|
|
|
|
2022-09-06 13:04:32 +02:00
|
|
|
$prezzi_ivati = setting('Utilizza prezzi di vendita comprensivi di IVA');
|
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
// Righe documento
|
|
|
|
$righe = $documento->getRighe();
|
|
|
|
|
2023-12-13 17:33:24 +01:00
|
|
|
if (!setting('Visualizza riferimento su ogni riga in stampa')) {
|
|
|
|
$riferimenti = [];
|
|
|
|
$id_rif = [];
|
|
|
|
|
|
|
|
foreach ($righe as $riga) {
|
|
|
|
$riferimento = ($riga->getOriginalComponent() ? $riga->getOriginalComponent()->getDocument()->getReference() : null);
|
|
|
|
if (!empty($riferimento)) {
|
|
|
|
if (!array_key_exists($riferimento, $riferimenti)) {
|
|
|
|
$riferimenti[$riferimento] = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!in_array($riga->id, $riferimenti[$riferimento])) {
|
|
|
|
$id_rif[] = $riga->id;
|
|
|
|
$riferimenti[$riferimento][] = $riga->id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-08 12:18:38 +02:00
|
|
|
$columns = 7;
|
2019-07-12 12:40:13 +02:00
|
|
|
|
2024-04-09 12:18:08 +02:00
|
|
|
$has_image = $righe->search(fn ($item) => !empty($item->articolo->immagine)) !== false && $options['images'] == true;
|
2023-03-31 14:36:08 +02:00
|
|
|
|
|
|
|
if ($has_image) {
|
|
|
|
++$columns;
|
|
|
|
$char_number = $options['pricing'] ? 26 : 63;
|
2020-12-15 17:59:43 +01:00
|
|
|
}
|
|
|
|
|
2021-02-18 18:48:44 +01:00
|
|
|
if ($documento->direzione == 'uscita') {
|
2021-07-07 15:01:51 +02:00
|
|
|
$columns += 2;
|
2019-07-12 12:40:13 +02:00
|
|
|
$char_number = $options['pricing'] ? 26 : 63;
|
|
|
|
} else {
|
|
|
|
$char_number = $options['pricing'] ? 45 : 82;
|
2019-01-10 17:27:19 +01:00
|
|
|
}
|
2019-07-12 12:40:13 +02:00
|
|
|
$columns = $options['pricing'] ? $columns : $columns - 3;
|
2017-09-12 17:46:19 +02:00
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
// Creazione righe fantasma
|
2024-05-23 12:25:09 +02:00
|
|
|
$autofill = new Util\Autofill($columns);
|
|
|
|
$autofill->setRows(20, 10);
|
2017-09-12 17:46:19 +02:00
|
|
|
|
|
|
|
// Intestazione tabella per righe
|
|
|
|
echo "
|
2024-05-23 16:05:30 +02:00
|
|
|
<table class='table table-striped border-bottom' id='contents'>
|
2017-09-12 17:46:19 +02:00
|
|
|
<thead>
|
2020-09-02 18:42:00 +02:00
|
|
|
<tr>
|
2024-05-23 12:25:09 +02:00
|
|
|
<th class='text-center text-muted' style='width:4%'>".tr('#', [], ['upper' => true]).'</th>';
|
2020-12-15 17:59:43 +01:00
|
|
|
|
2024-01-15 15:30:45 +01:00
|
|
|
if ($has_image) {
|
|
|
|
echo "
|
2024-05-23 12:25:09 +02:00
|
|
|
<th class='text-center text-muted' style='width:20%'>".tr('Immagine', [], ['upper' => true]).'</th>';
|
2024-01-15 15:30:45 +01:00
|
|
|
}
|
2019-07-12 12:40:13 +02:00
|
|
|
|
2024-01-15 15:30:45 +01:00
|
|
|
echo "
|
2024-05-23 12:25:09 +02:00
|
|
|
<th class='text-center text-muted'>".tr('Descrizione', [], ['upper' => true]).'</th>
|
2024-01-04 14:47:06 +01:00
|
|
|
';
|
2023-12-13 17:51:09 +01:00
|
|
|
|
2024-01-15 15:30:45 +01:00
|
|
|
if ($documento->direzione == 'uscita') {
|
|
|
|
echo "
|
2024-05-23 12:25:09 +02:00
|
|
|
<th class='text-center text-muted' style='width:10%'>".tr('Codice', [], ['upper' => true])."</th>
|
|
|
|
<th class='text-center text-muted' style='width:10%'>".tr('Codice fornitore', [], ['upper' => true]).'</th>';
|
2024-01-15 15:30:45 +01:00
|
|
|
}
|
|
|
|
echo "
|
2024-05-23 12:25:09 +02:00
|
|
|
<th class='text-center text-muted' style='width:9%'>".tr('Q.tà', [], ['upper' => true]).'</th>';
|
2019-07-12 12:40:13 +02:00
|
|
|
|
|
|
|
if ($options['pricing']) {
|
|
|
|
echo "
|
2024-05-23 12:25:09 +02:00
|
|
|
<th class='text-center text-muted' style='width:10%'>".tr('Prezzo unitario', [], ['upper' => true])."</th>
|
|
|
|
<th class='text-center text-muted' style='width:10%'>".tr('Imponibile', [], ['upper' => true])."</th>
|
|
|
|
<th class='text-center text-muted' style='width:5%'>".tr('IVA', [], ['upper' => true]).' (%)</th>';
|
2019-07-12 12:40:13 +02:00
|
|
|
}
|
|
|
|
|
2024-01-15 15:30:45 +01:00
|
|
|
echo "
|
2024-05-23 12:25:09 +02:00
|
|
|
<th class='text-center text-muted' style='width:10%'>".tr('Data evasione', [], ['upper' => true]).'</th>
|
2017-09-12 17:46:19 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
2021-04-12 15:51:27 +02:00
|
|
|
<tbody>';
|
2017-09-12 17:46:19 +02:00
|
|
|
|
2020-09-11 09:04:06 +02:00
|
|
|
$num = 0;
|
|
|
|
foreach ($righe as $riga) {
|
|
|
|
++$num;
|
2019-07-12 12:40:13 +02:00
|
|
|
$r = $riga->toArray();
|
|
|
|
|
|
|
|
$autofill->count($r['descrizione']);
|
2017-09-12 17:46:19 +02:00
|
|
|
|
|
|
|
echo '
|
2020-09-11 09:04:06 +02:00
|
|
|
<tr>
|
2023-12-13 17:33:24 +01:00
|
|
|
<td class="text-center" style="vertical-align: middle">';
|
|
|
|
|
|
|
|
$text = '';
|
|
|
|
|
|
|
|
foreach ($riferimenti as $key => $riferimento) {
|
|
|
|
if (in_array($riga->id, $riferimento)) {
|
|
|
|
if ($riga->id === $riferimento[0]) {
|
|
|
|
$riga_ordine = $database->fetchOne('SELECT numero_cliente, data_cliente FROM or_ordini WHERE id = '.prepare($riga->idordine));
|
|
|
|
if (!empty($riga_ordine['numero_cliente']) && !empty($riga_ordine['data_cliente'])) {
|
|
|
|
$text = $text.'<b>Ordine n. '.$riga_ordine['numero_cliente'].' del '.Translator::dateToLocale($riga_ordine['data_cliente']).'</b><br>';
|
|
|
|
}
|
2024-05-23 11:36:25 +02:00
|
|
|
$r['descrizione'] = str_replace('Rif. '.strtolower((string) $key), '', $r['descrizione']);
|
2023-12-13 17:33:24 +01:00
|
|
|
preg_match("/Rif\.(.*)/s", $r['descrizione'], $rif2);
|
|
|
|
$r['descrizione'] = str_replace('Rif.'.strtolower($rif2[1]), '', $r['descrizione']);
|
2024-01-04 14:47:06 +01:00
|
|
|
|
2023-12-13 17:33:24 +01:00
|
|
|
if (!empty($rif2)) {
|
|
|
|
$text .= '<b>'.$rif2[0].'</b>';
|
|
|
|
}
|
|
|
|
$text .= '<b>'.$key.'</b></td>';
|
|
|
|
if ($options['pricing']) {
|
|
|
|
$text .= '
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
|
|
<td></td>';
|
|
|
|
}
|
|
|
|
|
|
|
|
$text .= '<td></td><td></td></tr><tr><td class="text-center" nowrap="nowrap" style="vertical-align: middle">';
|
|
|
|
|
|
|
|
echo '
|
2023-12-13 17:51:09 +01:00
|
|
|
</td>';
|
|
|
|
if ($has_image) {
|
|
|
|
echo '
|
|
|
|
<td></td>';
|
|
|
|
}
|
2024-01-04 14:47:06 +01:00
|
|
|
echo '
|
2023-12-13 17:33:24 +01:00
|
|
|
<td>
|
|
|
|
'.nl2br($text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$r['descrizione'] = preg_replace("/Rif\.(.*)/s", '', $r['descrizione']);
|
|
|
|
$autofill->count($r['descrizione']);
|
|
|
|
}
|
|
|
|
|
2024-05-23 11:36:25 +02:00
|
|
|
$source_type = $riga::class;
|
2023-12-13 17:33:24 +01:00
|
|
|
if (!setting('Visualizza riferimento su ogni riga in stampa')) {
|
2023-12-13 17:51:09 +01:00
|
|
|
echo $num.'</td>';
|
|
|
|
if ($has_image) {
|
|
|
|
if ($riga->isArticolo() && !empty($riga->articolo->image)) {
|
|
|
|
echo '
|
|
|
|
<td align="center">
|
|
|
|
<img src="'.$riga->articolo->image.'" style="max-height: 80px; max-width:120px">
|
|
|
|
</td>';
|
|
|
|
} else {
|
|
|
|
echo '
|
|
|
|
<td></td>';
|
|
|
|
}
|
|
|
|
}
|
2024-01-04 14:47:06 +01:00
|
|
|
echo '
|
2023-12-13 17:33:24 +01:00
|
|
|
<td>'.$r['descrizione'];
|
|
|
|
} else {
|
|
|
|
echo $num.'
|
2024-01-10 15:08:09 +01:00
|
|
|
</td>';
|
|
|
|
if ($has_image) {
|
|
|
|
if ($riga->isArticolo() && !empty($riga->articolo->image)) {
|
|
|
|
echo '
|
|
|
|
<td align="center">
|
|
|
|
<img src="'.$riga->articolo->image.'" style="max-height: 80px; max-width:120px">
|
|
|
|
</td>';
|
|
|
|
} else {
|
|
|
|
echo '
|
|
|
|
<td></td>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo '
|
2024-05-23 11:36:25 +02:00
|
|
|
<td>'.nl2br((string) $r['descrizione']);
|
2023-12-13 17:33:24 +01:00
|
|
|
}
|
2020-09-02 18:42:00 +02:00
|
|
|
|
2021-07-07 15:01:51 +02:00
|
|
|
if ($documento->direzione == 'uscita') {
|
|
|
|
echo '
|
|
|
|
<td class="text-center" style="vertical-align: middle">
|
|
|
|
'.$riga->articolo->codice.'
|
|
|
|
</td>
|
|
|
|
<td class="text-center" style="vertical-align: middle">
|
|
|
|
'.($riga->articolo ? $riga->articolo->dettaglioFornitore($documento->idanagrafica)->codice_fornitore : '').'
|
|
|
|
</td>';
|
2021-07-15 10:58:36 +02:00
|
|
|
}
|
2021-07-07 15:01:51 +02:00
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
if ($riga->isArticolo()) {
|
2023-03-10 16:38:53 +01:00
|
|
|
if ($documento->direzione == 'entrata' && !$options['hide-item-number']) {
|
2021-04-08 12:18:38 +02:00
|
|
|
// Codice articolo
|
|
|
|
$text = tr('COD. _COD_', [
|
|
|
|
'_COD_' => $riga->codice,
|
|
|
|
]);
|
|
|
|
echo '
|
|
|
|
<br><small>'.$text.'</small>';
|
2017-09-12 17:46:19 +02:00
|
|
|
|
2021-04-08 12:18:38 +02:00
|
|
|
$autofill->count($text, true);
|
|
|
|
}
|
2017-09-12 17:46:19 +02:00
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
// Seriali
|
|
|
|
$seriali = $riga->serials;
|
|
|
|
if (!empty($seriali)) {
|
2019-07-12 13:04:28 +02:00
|
|
|
$text = tr('SN').': '.implode(', ', $seriali);
|
2019-07-12 12:40:13 +02:00
|
|
|
echo '
|
|
|
|
<br><small>'.$text.'</small>';
|
2018-02-15 14:25:27 +01:00
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
$autofill->count($text, true);
|
2018-02-15 14:25:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-12 17:46:19 +02:00
|
|
|
echo '
|
|
|
|
</td>';
|
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
if (!$riga->isDescrizione()) {
|
2020-10-02 18:27:07 +02:00
|
|
|
$qta = $riga->qta;
|
|
|
|
$um = $r['um'];
|
|
|
|
|
|
|
|
if ($riga->isArticolo() && $documento->direzione == 'uscita' && !empty($riga->articolo->um_secondaria)) {
|
|
|
|
$um = $riga->articolo->um_secondaria;
|
|
|
|
$qta *= $riga->articolo->fattore_um_secondaria;
|
|
|
|
}
|
|
|
|
|
2018-02-15 17:41:09 +01:00
|
|
|
echo '
|
2019-07-12 12:40:13 +02:00
|
|
|
<td class="text-center">
|
2023-12-05 17:43:35 +01:00
|
|
|
'.Translator::numberToLocale(abs($qta), $d_qta).' '.$um.'
|
2017-09-12 17:46:19 +02:00
|
|
|
</td>';
|
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
if ($options['pricing']) {
|
|
|
|
// Prezzo unitario
|
2018-02-15 17:41:09 +01:00
|
|
|
echo '
|
2019-07-12 12:40:13 +02:00
|
|
|
<td class="text-right">
|
2023-12-05 17:43:35 +01:00
|
|
|
'.moneyFormat($prezzi_ivati ? $riga->prezzo_unitario_ivato : $riga->prezzo_unitario, $d_importi);
|
2018-01-18 19:03:06 +01:00
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
if ($riga->sconto > 0) {
|
2020-02-15 14:11:44 +01:00
|
|
|
$text = discountInfo($riga, false);
|
2019-07-12 12:40:13 +02:00
|
|
|
|
|
|
|
echo '
|
|
|
|
<br><small class="text-muted">'.$text.'</small>';
|
|
|
|
|
|
|
|
$autofill->count($text, true);
|
2017-09-21 10:01:07 +02:00
|
|
|
}
|
2019-07-12 12:40:13 +02:00
|
|
|
|
|
|
|
echo '
|
2017-09-12 17:46:19 +02:00
|
|
|
</td>';
|
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
// Imponibile
|
2018-02-15 17:41:09 +01:00
|
|
|
echo '
|
2019-07-12 12:40:13 +02:00
|
|
|
<td class="text-right">
|
2023-12-05 17:43:35 +01:00
|
|
|
'.moneyFormat($prezzi_ivati ? $riga->totale : $riga->totale_imponibile, $d_importi).'
|
2019-07-12 12:40:13 +02:00
|
|
|
</td>';
|
2018-01-18 19:03:06 +01:00
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
// Iva
|
|
|
|
echo '
|
|
|
|
<td class="text-center">
|
2023-12-21 11:25:05 +01:00
|
|
|
'.Translator::numberToLocale($riga->aliquota->percentuale, 0).'
|
2017-09-12 17:46:19 +02:00
|
|
|
</td>';
|
2019-07-12 12:40:13 +02:00
|
|
|
}
|
2021-04-08 12:18:38 +02:00
|
|
|
|
|
|
|
echo '
|
|
|
|
<td class="text-center">
|
2021-07-07 15:01:51 +02:00
|
|
|
'.Translator::dateToLocale($riga->data_evasione).($riga->ora_evasione ? '<br>'.Translator::timeToLocale($riga->ora_evasione).'' : '').'
|
2021-04-08 12:18:38 +02:00
|
|
|
</td>';
|
2017-09-12 17:46:19 +02:00
|
|
|
} else {
|
|
|
|
echo '
|
2019-07-12 12:40:13 +02:00
|
|
|
<td></td>';
|
2017-09-12 17:46:19 +02:00
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
if ($options['pricing']) {
|
|
|
|
echo '
|
|
|
|
<td></td>
|
|
|
|
<td></td>
|
|
|
|
<td></td>';
|
|
|
|
}
|
2018-01-18 19:03:06 +01:00
|
|
|
}
|
2019-07-12 12:40:13 +02:00
|
|
|
|
2018-01-18 19:03:06 +01:00
|
|
|
echo '
|
2017-09-12 17:46:19 +02:00
|
|
|
</tr>';
|
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
$autofill->next();
|
2017-09-12 17:46:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
echo '
|
|
|
|
|autofill|
|
|
|
|
</tbody>';
|
|
|
|
|
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
|
|
|
|
|
|
|
$show_sconto = $sconto > 0;
|
|
|
|
|
2021-04-08 12:18:38 +02:00
|
|
|
$colspan = 5;
|
2024-01-15 15:30:45 +01:00
|
|
|
$documento->direzione == 'uscita' ? $colspan += 2 : $colspan;
|
|
|
|
$has_image ? $colspan++ : $colspan;
|
2020-12-15 17:59:43 +01:00
|
|
|
|
2017-09-12 17:46:19 +02:00
|
|
|
// TOTALE COSTI FINALI
|
2017-09-21 15:51:39 +02:00
|
|
|
if ($options['pricing']) {
|
2017-09-12 17:46:19 +02:00
|
|
|
// Totale imponibile
|
|
|
|
echo '
|
|
|
|
<tr>
|
2024-05-23 12:25:09 +02:00
|
|
|
<td colspan="'.$colspan.'" class="text-right text-muted">
|
2017-09-12 17:46:19 +02:00
|
|
|
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
|
|
|
|
</td>
|
|
|
|
|
2019-05-02 10:03:57 +02:00
|
|
|
<th colspan="2" class="text-right">
|
2023-12-06 10:06:36 +01:00
|
|
|
<b>'.moneyFormat($show_sconto ? $imponibile : $totale_imponibile, $d_totali).'</b>
|
2017-09-12 17:46:19 +02:00
|
|
|
</th>
|
|
|
|
</tr>';
|
|
|
|
|
|
|
|
// Eventuale sconto incondizionato
|
2019-07-12 12:40:13 +02:00
|
|
|
if ($show_sconto) {
|
2017-09-12 17:46:19 +02:00
|
|
|
echo '
|
|
|
|
<tr>
|
2024-05-23 12:25:09 +02:00
|
|
|
<td colspan="'.$colspan.'" class="text-right text-muted">
|
2017-09-12 17:46:19 +02:00
|
|
|
<b>'.tr('Sconto', [], ['upper' => true]).':</b>
|
|
|
|
</td>
|
|
|
|
|
2019-05-02 10:03:57 +02:00
|
|
|
<th colspan="2" class="text-right">
|
2023-12-06 10:06:36 +01:00
|
|
|
<b>'.moneyFormat($sconto, $d_totali).'</b>
|
2017-09-12 17:46:19 +02:00
|
|
|
</th>
|
|
|
|
</tr>';
|
|
|
|
|
2019-07-11 17:44:42 +02:00
|
|
|
// Totale imponibile
|
2017-09-12 17:46:19 +02:00
|
|
|
echo '
|
|
|
|
<tr>
|
2024-05-23 12:25:09 +02:00
|
|
|
<td colspan="'.$colspan.'" class="text-right text-muted">
|
2019-07-11 17:44:42 +02:00
|
|
|
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
2017-09-12 17:46:19 +02:00
|
|
|
</td>
|
|
|
|
|
2019-05-02 10:03:57 +02:00
|
|
|
<th colspan="2" class="text-right">
|
2023-12-06 10:06:36 +01:00
|
|
|
<b>'.moneyFormat($totale_imponibile, $d_totali).'</b>
|
2017-09-12 17:46:19 +02:00
|
|
|
</th>
|
|
|
|
</tr>';
|
|
|
|
}
|
|
|
|
|
|
|
|
// IVA
|
|
|
|
echo '
|
|
|
|
<tr>
|
2024-05-23 12:25:09 +02:00
|
|
|
<td colspan="'.$colspan.'" class="text-right text-muted">
|
2017-09-12 17:46:19 +02:00
|
|
|
<b>'.tr('Totale IVA', [], ['upper' => true]).':</b>
|
|
|
|
</td>
|
|
|
|
|
2019-05-02 10:03:57 +02:00
|
|
|
<th colspan="2" class="text-right">
|
2023-12-06 10:06:36 +01:00
|
|
|
<b>'.moneyFormat($totale_iva, $d_totali).'</b>
|
2017-09-12 17:46:19 +02:00
|
|
|
</th>
|
|
|
|
</tr>';
|
|
|
|
|
|
|
|
// TOTALE
|
|
|
|
echo '
|
|
|
|
<tr>
|
2024-05-23 12:25:09 +02:00
|
|
|
<td colspan="'.$colspan.'" class="text-right text-muted" >
|
2019-07-12 12:40:13 +02:00
|
|
|
<b>'.tr('Totale documento', [], ['upper' => true]).':</b>
|
2017-09-12 17:46:19 +02:00
|
|
|
</td>
|
2019-05-02 10:03:57 +02:00
|
|
|
<th colspan="2" class="text-right">
|
2023-12-06 10:06:36 +01:00
|
|
|
<b>'.moneyFormat($totale, $d_totali).'</b>
|
2017-09-12 17:46:19 +02:00
|
|
|
</th>
|
|
|
|
</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
|
|
|
// SCONTO IN FATTURA
|
2021-04-06 15:44:51 +02:00
|
|
|
echo '
|
|
|
|
<tr>
|
2024-05-23 12:25:09 +02:00
|
|
|
<td colspan="'.$colspan.'" class="text-right text-muted">
|
2022-01-15 17:30:49 +01:00
|
|
|
<b>'.tr('Sconto in fattura', [], ['upper' => true]).':</b>
|
2021-04-06 15:44:51 +02:00
|
|
|
</td>
|
|
|
|
<th colspan="2" class="text-right">
|
2023-12-06 10:06:36 +01:00
|
|
|
<b>'.moneyFormat($sconto_finale, $d_totali).'</b>
|
2021-04-06 15:44:51 +02:00
|
|
|
</th>
|
|
|
|
</tr>';
|
|
|
|
|
|
|
|
// NETTO A PAGARE
|
|
|
|
echo '
|
|
|
|
<tr>
|
2024-05-23 16:05:30 +02:00
|
|
|
<td colspan="'.$colspan.'" class="text-right text-muted">
|
2021-04-06 15:44:51 +02:00
|
|
|
<b>'.tr('Netto a pagare', [], ['upper' => true]).':</b>
|
|
|
|
</td>
|
|
|
|
<th colspan="2" class="text-right">
|
2023-12-06 10:06:36 +01:00
|
|
|
<b>'.moneyFormat($netto_a_pagare, $d_totali).'</b>
|
2021-04-06 15:44:51 +02:00
|
|
|
</th>
|
|
|
|
</tr>';
|
|
|
|
}
|
2017-09-12 17:46:19 +02:00
|
|
|
}
|
|
|
|
|
2018-02-15 17:41:09 +01:00
|
|
|
echo '
|
2017-09-12 17:46:19 +02:00
|
|
|
</table>';
|
|
|
|
|
2022-10-27 15:08:33 +02:00
|
|
|
if (!empty($documento->condizioni_fornitura)) {
|
|
|
|
echo '<pagebreak>'.$documento->condizioni_fornitura;
|
|
|
|
}
|
|
|
|
|
2019-07-12 12:40:13 +02:00
|
|
|
if (!empty($documento['note'])) {
|
2017-09-12 17:46:19 +02:00
|
|
|
echo '
|
|
|
|
<br>
|
2024-05-23 12:25:09 +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>';
|
2023-08-04 14:54:28 +02:00
|
|
|
}
|