2017-09-07 16:51:14 +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-07 16:51:14 +02:00
2024-05-20 12:55:29 +02:00
if ( ! $is_last_page ) {
2019-07-29 16:54:20 +02:00
return ;
}
2024-03-18 16:04:01 +01:00
2024-09-30 17:32:35 +02:00
$imponibile = 0 ;
foreach ( $v_totale as $key => $v ) {
$totale_scontato += $v ;
2024-03-18 16:04:01 +01:00
}
$sconto = 0 ;
2024-03-22 15:52:24 +01:00
foreach ( $righe as $riga ) {
2024-03-18 16:04:01 +01:00
$sconto += floatval ( $riga -> sconto );
}
2024-09-30 17:32:35 +02:00
$imponibile = $totale_scontato + $sconto ;
$rivalsa = 0 ;
foreach ( $righe as $riga ) {
$rivalsa += floatval ( $riga -> rivalsainps );
}
$totale_imponibile = $totale_scontato + $rivalsa ;
$totale_iva = 0 ;
foreach ( $righe as $riga ) {
$aliquota = $database -> fetchOne ( 'SELECT percentuale FROM co_iva WHERE id = ' . prepare ( $riga -> idiva ))[ 'percentuale' ];
2024-10-07 16:27:30 +02:00
$totale_iva += $riga [ 'iva' ] + $riga [ 'rivalsainps' ] * $aliquota / 100 ;;
2024-09-30 17:32:35 +02:00
}
2024-03-18 16:04:01 +01:00
$totale = $totale_iva + $totale_imponibile ;
2019-07-11 18:10:38 +02:00
$show_sconto = $sconto > 0 ;
2019-07-12 17:35:14 +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-16 10:34:51 +02:00
2019-07-11 18:10:38 +02:00
$width = round ( 100 / ( $show_sconto ? 5 : 3 ), 2 );
2024-09-30 17:32:35 +02:00
$has_rivalsa = ! empty ( $rivalsa );
2024-10-15 15:43:51 +02:00
$has_ritenuta = ! empty ( $record [ 'ritenutaacconto' ]) || ! empty ( $documento -> totale_ritenuta_contributi );
2021-03-01 17:37:44 +01:00
$has_split_payment = ! empty ( $record [ 'split_payment' ]);
$has_sconto_finale = ! empty ( $sconto_finale );
$etichette = [
2024-09-30 17:32:35 +02:00
'totale' => tr ( 'Totale imponibile' , [], [ 'upper' => true ]),
'totale_parziale' => tr ( 'Totale documento' , [], [ 'upper' => true ]),
2021-03-01 17:37:44 +01:00
'totale_finale' => tr ( 'Netto a pagare' , [], [ 'upper' => true ]),
];
2017-09-07 16:51:14 +02:00
// SCADENZE | TOTALI
// TABELLA PRINCIPALE
echo "
2017-09-13 11:15:31 +02:00
< table class = 'table-bordered' >
2017-09-07 16:51:14 +02:00
< tr >
2019-07-11 18:10:38 +02:00
< td colspan = " .( $show_sconto ? 5 : 3). " class = 'cell-padded' style = 'height:".($record[' ritenutaacconto '] != 0 ? 20 : 30)."mm' > " ;
2017-09-07 16:51:14 +02:00
// Tabella (scadenze + iva)
echo "
2017-09-13 11:15:31 +02:00
< table class = 'table-normal' >
2017-09-07 16:51:14 +02:00
< tr >
2017-09-13 11:15:31 +02:00
< td style = 'width:10mm;' >& nbsp ; </ td >
2023-11-24 13:20:00 +01:00
< td style = 'width:80mm;' >
2017-09-13 11:15:31 +02:00
< table class = 'border-bottom' >
2017-09-07 16:51:14 +02:00
< tr >
2023-11-24 13:20:00 +01:00
< td colspan = '4' >
2024-05-22 13:15:34 +02:00
< p class = 'small-bold text-muted' > " .tr('Scadenze pagamenti', [], ['upper' => true]).'</p>
2017-09-07 16:51:14 +02:00
</ td >
</ tr > ' ;
// Elenco scadenze
2024-02-08 13:10:46 +01:00
$rs2 = $dbo -> fetchArray ( 'SELECT * FROM `co_scadenziario` WHERE `iddocumento`=' . prepare ( $id_record ) . ' ORDER BY `scadenza` ASC' );
2017-09-07 16:51:14 +02:00
if ( ! empty ( $rs2 )) {
for ( $i = 0 ; $i < sizeof ( $rs2 ); ++ $i ) {
2024-05-13 12:37:45 +02:00
$pagamento = $dbo -> fetchOne ( 'SELECT `fe_modalita_pagamento_lang`.`title` as descrizione FROM `co_pagamenti` INNER JOIN `fe_modalita_pagamento` ON `fe_modalita_pagamento`.`codice` = `co_pagamenti`.`codice_modalita_pagamento_fe` LEFT JOIN `fe_modalita_pagamento_lang` ON (`fe_modalita_pagamento_lang`.`id_record`=`fe_modalita_pagamento`.`codice` AND `fe_modalita_pagamento_lang`.`id_lang`=' . prepare ( Models\Locale :: getDefault () -> id ) . ') WHERE `co_pagamenti`.`id`=' . $rs2 [ $i ][ 'id_pagamento' ])[ 'descrizione' ];
2023-10-27 10:35:05 +02:00
echo '
2017-09-07 16:51:14 +02:00
< tr >
2023-11-24 13:20:00 +01:00
< td style = \ ' width : 15 % ; \ ' >
2023-10-27 10:35:05 +02:00
< small > '.Translator::dateToLocale($rs2[$i][' scadenza ' ]) . " </small>
2017-09-07 16:51:14 +02:00
</ td >
2024-05-13 12:37:45 +02:00
< td style = 'width:15%;' >
2023-09-15 17:06:37 +02:00
" .(( $rs2[$i] ['pagato'] == $rs2[$i] ['da_pagare']) ? '<small>PAGATO</small>' : ''). "
2023-09-14 17:54:11 +02:00
</ td >
2024-05-13 12:37:45 +02:00
< td style = 'width:15%;' >
2023-12-06 10:06:36 +01:00
< small > " .moneyFormat( $rs2[$i] ['da_pagare'], $d_totali ).'</small>
2017-09-07 16:51:14 +02:00
</ td >
2023-11-24 13:20:00 +01:00
< td style = \ ' width : 15 % ; \ ' >
< small > '.$pagamento.' </ small >
</ td >
2017-09-07 16:51:14 +02:00
</ tr > ' ;
}
}
2017-09-13 11:15:31 +02:00
2024-05-22 13:15:34 +02:00
echo '
2017-09-07 16:51:14 +02:00
</ table >
</ td > ' ;
// Fine elenco scadenze
// Separatore
echo "
< td style = 'width:10mm;' >& nbsp ; </ td > " ;
// Tabella iva
echo "
< td style = 'width:75mm;' > " ;
if ( ! empty ( $v_iva )) {
echo "
2017-09-13 11:15:31 +02:00
< table class = 'border-bottom' >
2017-09-07 16:51:14 +02:00
< tr >
2017-09-13 11:15:31 +02:00
< td style = 'width:40mm;' >
2024-05-22 13:15:34 +02:00
< p class = 'small-bold text-muted' > " .tr('Aliquota IVA', [], ['upper' => true]). " </ p >
2017-09-07 16:51:14 +02:00
</ td >
2017-09-13 11:15:31 +02:00
< td style = 'width:20mm;' class = 'text-center' >
2024-05-22 13:15:34 +02:00
< p class = 'small-bold text-muted' > " .tr('Importo', [], ['upper' => true]). " </ p >
2017-09-07 16:51:14 +02:00
</ td >
2017-09-13 11:15:31 +02:00
< td style = 'width:20mm;' class = 'text-center' >
2024-05-22 13:15:34 +02:00
< p class = 'small-bold text-muted' > " .tr('Importo IVA', [], ['upper' => true]).'</p>
2017-09-07 16:51:14 +02:00
</ td >
</ tr > ' ;
foreach ( $v_iva as $desc_iva => $tot_iva ) {
if ( ! empty ( $desc_iva )) {
2017-09-13 11:15:31 +02:00
echo '
2017-09-07 16:51:14 +02:00
< tr >
2017-09-13 11:15:31 +02:00
< td >
< small > ' . $desc_iva . " </small>
2017-09-07 16:51:14 +02:00
</ td >
2017-09-13 11:15:31 +02:00
< td class = 'text-right' >
2023-12-06 10:06:36 +01:00
< small > " .moneyFormat( $v_totale[$desc_iva] , $d_totali ). " </ small >
2017-09-07 16:51:14 +02:00
</ td >
2017-09-13 11:15:31 +02:00
< td class = 'text-right' >
2023-12-06 10:06:36 +01:00
< small > " .moneyFormat( $v_iva[$desc_iva] , $d_totali ).'</small>
2017-09-07 16:51:14 +02:00
</ td >
</ tr > ' ;
}
}
echo '
2024-05-22 13:15:34 +02:00
</ table >
< br >
< table class = " border-bottom " >
< tr >
< td >
</ td >
< td >
< p >< small > $appoggiobancario $ </ small ></ p >
</ td >
</ tr >
< tr >
< td >
< p class = " small-bold text-muted " > '.tr(' IBAN ').' </ p >
</ td >
< td >
2024-05-23 16:05:30 +02:00
< p >< small > $codiceiban $ </ small ></ p >
2024-05-22 13:15:34 +02:00
</ td >
</ tr >
< tr >
< td >
< p class = " small-bold text-muted " > '.tr(' BIC ').' </ p >
</ td >
< td >
2024-05-23 16:05:30 +02:00
< p >< small > $bic $ </ small ></ p >
2024-05-22 13:15:34 +02:00
</ td >
</ tr >
2017-09-07 16:51:14 +02:00
</ table > ' ;
}
echo '
</ td >
2019-07-11 18:10:38 +02:00
< td style = " width:10mm; " >& nbsp ; </ td >
2017-09-07 16:51:14 +02:00
</ tr > ' ;
// Fine tabelle iva
echo '
</ table > ' ;
// Fine tabella (scadenze + iva)
echo '
2024-05-22 13:15:34 +02:00
</ td >
' ;
2017-09-07 16:51:14 +02:00
2021-03-01 17:37:44 +01:00
/*
* Riga di riepilogo dei totali .
* Se sconto : Imponibile | Sconto | Totale imponibile | Totale IVA | Totale
* Altrimenti : Imponibile | Totale IVA | Totale
*/
2024-09-30 17:32:35 +02:00
if ( $has_ritenuta || $show_sconto || $has_rivalsa ) {
2017-09-07 16:51:14 +02:00
echo "
2017-09-13 11:15:31 +02:00
< tr >
< th class = 'text-center small' style = 'width:".$width."' >
2024-09-30 17:32:35 +02:00
" .tr('Imponibile', [], ['upper' => true]). "
</ th > " ;
} else {
echo "
< tr >
< th class = 'text-center small' style = 'width:".$width."' >
</ th > " ;
}
2019-07-11 18:10:38 +02:00
if ( $show_sconto ) {
2017-09-21 16:42:27 +02:00
echo "
2017-09-13 11:15:31 +02:00
< th class = 'text-center small' style = 'width:".$width."' >
" .tr('Sconto', [], ['upper' => true]). "
</ th >
< th class = 'text-center small' style = 'width:".$width."' >
2024-09-30 17:32:35 +02:00
" .tr('Totale scontato', [], ['upper' => true]).'
2017-09-21 16:42:27 +02:00
</ th > ' ;
2017-09-13 11:15:31 +02:00
}
2024-09-30 17:32:35 +02:00
if ( $has_rivalsa ) {
2017-09-07 16:51:14 +02:00
echo "
2017-09-13 11:15:31 +02:00
< th class = 'text-center small' style = 'width:".$width."' >
2024-09-30 17:32:35 +02:00
" .tr('Cassa Previdenziale', [], ['upper' => true]). "
</ th > " ;
} else {
echo "
< th class = 'text-center small' style = 'width:".$width."' >
</ th > " ;
}
echo "
2017-09-13 11:15:31 +02:00
< th class = 'text-center small' style = 'width:".$width."' >
2024-09-30 17:32:35 +02:00
" .(( $show_sconto ) ? $etichette['totale_parziale'] : $etichette['totale'] ). "
2017-09-13 11:15:31 +02:00
</ th >
2024-09-30 17:32:35 +02:00
</ tr > " ;
2017-09-07 16:51:14 +02:00
2024-10-15 15:43:51 +02:00
if ( $has_ritenuta || $show_sconto || $has_rivalsa ) {
2024-09-30 17:32:35 +02:00
echo "
2017-09-07 16:51:14 +02:00
< tr >
2017-09-13 11:15:31 +02:00
< td class = 'cell-padded text-center' >
2024-09-30 17:32:35 +02:00
" .moneyFormat( $imponibile , $d_totali ).'
2017-09-21 16:42:27 +02:00
</ td > ' ;
2024-09-30 17:32:35 +02:00
} else {
echo "
< tr >
< td class = 'cell-padded text-center' >
</ td > " ;
}
2017-09-13 11:15:31 +02:00
2019-07-11 18:10:38 +02:00
if ( $show_sconto ) {
2017-09-13 11:15:31 +02:00
echo "
< td class = 'cell-padded text-center' >
2023-12-06 10:06:36 +01:00
" .moneyFormat(abs( $sconto ), $d_totali ). "
2017-09-07 16:51:14 +02:00
</ td >
2017-09-13 11:15:31 +02:00
< td class = 'cell-padded text-center' >
2024-09-30 17:32:35 +02:00
" .moneyFormat( $totale_scontato , $d_totali ).'
2017-09-21 16:42:27 +02:00
</ td > ' ;
2024-09-30 17:32:35 +02:00
} else if ( ! $has_rivalsa ) {
echo "
2017-09-13 11:15:31 +02:00
< td class = 'cell-padded text-center' >
2024-09-30 17:32:35 +02:00
</ td > " ;
}
2017-09-07 16:51:14 +02:00
2021-03-01 17:37:44 +01:00
/*
* Riga di riepilogo della Rivalsa INPS .
* Rivalsa INPS | Totale ( + Rivalsa INPS )
*/
if ( $has_rivalsa ) {
2024-10-07 16:27:30 +02:00
$rs2 = $dbo -> fetchArray ( 'SELECT percentuale, descrizione FROM co_rivalse WHERE id IN (SELECT idrivalsainps FROM co_righe_documenti WHERE iddocumento=' . prepare ( $id_record ) . ' AND idrivalsainps!=0)' );
2017-12-20 14:05:14 +01:00
2024-10-07 16:27:30 +02:00
foreach ( $rs2 as $rs ) {
$descrizione .= '<p class="text-muted small-bold">' . $rs [ 'descrizione' ] . '</p>' ;
}
2024-09-30 17:32:35 +02:00
echo '
< td class = " cell-padded text-center " >
'.moneyFormat($rivalsa, 2).'
2024-10-07 16:27:30 +02:00
'.$descrizione.'
2024-09-30 17:32:35 +02:00
</ td >
< td class = " cell-padded text-center " >
'.moneyFormat($totale_imponibile, $d_totali).'
</ td >
</ tr > ' ;
2024-10-07 16:27:30 +02:00
2024-09-30 17:32:35 +02:00
} else if ( $show_sconto ) {
echo '
< td class = " cell-padded text-center " >
</ td >
< td class = " cell-padded text-center " >
'.moneyFormat($totale_imponibile, $d_totali).'
</ td >
</ tr > ' ;
} else {
echo '
< td class = " cell-padded text-center " >
'.moneyFormat($totale_imponibile, $d_totali).'
</ td > ' ;
}
2019-05-04 00:32:28 +02:00
2024-09-30 17:32:35 +02:00
$first_colspan = 3 ;
$second_colspan = 2 ;
2017-12-20 14:05:14 +01:00
2024-09-30 17:32:35 +02:00
if ( empty ( $sconto )) {
-- $first_colspan ;
-- $second_colspan ;
}
2017-12-20 14:05:14 +01:00
2024-09-30 17:32:35 +02:00
echo '
< tr >
< th class = " text-center small " colspan = " '. $first_colspan .' " >
'.tr(' Totale IVA ', [], [' upper ' => true]).'
</ th >
2017-12-20 14:05:14 +01:00
2024-09-30 17:32:35 +02:00
< th class = " text-center small " colspan = " '. $second_colspan .' " >
'.(!$has_ritenuta && !$has_split_payment && !$has_sconto_finale ? $etichette[' totale_finale '] : $etichette[' totale_parziale ']).'
</ th >
</ tr >
2017-12-20 14:05:14 +01:00
2024-09-30 17:32:35 +02:00
< tr >
2017-12-20 14:05:14 +01:00
< td class = " cell-padded text-center " colspan = " '. $first_colspan .' " >
2024-09-30 17:32:35 +02:00
'.moneyFormat($totale_iva, $d_totali).'
2024-10-07 16:36:32 +02:00
</ td > ' ;
2024-10-15 15:43:51 +02:00
if ( $has_ritenuta || $show_sconto || $has_rivalsa || $has_split_payment || $has_sconto_finale ) {
2024-10-07 16:36:32 +02:00
echo '<td class="cell-padded text-center" colspan="' . $second_colspan . ' " >
' . moneyFormat ( $totale , $d_total );
} else {
echo '
< td class = " cell-padded text-center " colspan = " '. $second_colspan .' " style = " background-color:#77dd77; " >
< b > '.moneyFormat($totale, $d_total).' </ b > ' ;
}
echo '
2017-12-20 14:05:14 +01:00
</ td >
2024-09-30 17:32:35 +02:00
</ tr > ' ;
2017-12-20 14:05:14 +01:00
2021-03-01 17:37:44 +01:00
/*
* Riga di riepilogo di Ritenuta d ' acconto e Ritenuta contributi .
* Ritenuta | Totale ( + Rivalsa INPS - Ritenuta )
*/
if ( $has_ritenuta ) {
2017-09-21 15:51:39 +02:00
$rs2 = $dbo -> fetchArray ( 'SELECT percentuale FROM co_ritenutaacconto WHERE id=(SELECT idritenutaacconto FROM co_righe_documenti WHERE iddocumento=' . prepare ( $id_record ) . ' AND idritenutaacconto!=0 LIMIT 0,1)' );
2017-09-07 16:51:14 +02:00
2017-12-20 14:05:14 +01:00
$first_colspan = 3 ;
$second_colspan = 2 ;
2019-04-19 17:31:52 +02:00
2017-12-20 14:05:14 +01:00
if ( empty ( $sconto )) {
-- $first_colspan ;
-- $second_colspan ;
}
2022-09-13 11:18:53 +02:00
$contributi = tr ( '_DESCRIZIONE_: _PRC_%' , [
'_DESCRIZIONE_' => $documento -> ritenutaContributi -> descrizione ,
2019-07-12 12:40:13 +02:00
'_PRC_' => Translator :: numberToLocale ( $documento -> ritenutaContributi -> percentuale , 2 ),
2019-03-01 15:30:54 +01:00
]);
2022-09-13 11:18:53 +02:00
$ritenuta_contributi_totale = abs ( $documento -> totale_ritenuta_contributi );
2019-03-01 15:30:54 +01:00
$acconto = tr ( 'acconto: _PRC_%' , [
2022-05-26 17:25:19 +02:00
'_PRC_' => Translator :: numberToLocale ( $rs2 [ 0 ][ 'percentuale' ], 2 ),
2019-03-01 15:30:54 +01:00
]);
2022-09-13 11:18:53 +02:00
$ritenuta_acconto_totale = abs ( $documento -> ritenuta_acconto );
2019-03-01 15:30:54 +01:00
2022-09-13 11:18:53 +02:00
if ( ! empty ( $ritenuta_acconto_totale ) && ! empty ( $ritenuta_contributi_totale )) {
-- $first_colspan ;
}
2017-12-20 14:05:14 +01:00
echo '
2022-09-13 11:18:53 +02:00
< tr > ' ;
if ( ! empty ( $ritenuta_acconto_totale )) {
echo '
2017-12-20 14:05:14 +01:00
< th class = " text-center small " colspan = " '. $first_colspan .' " >
2022-09-13 11:18:53 +02:00
'.tr(' Ritenuta _ACCONTO_ ' , [
'_ACCONTO_' => $acconto ,
2024-03-22 15:52:24 +01:00
], [ 'upper' => true ]) . '
2022-09-13 11:18:53 +02:00
</ th > ' ;
}
if ( ! empty ( $ritenuta_contributi_totale )) {
echo '
< th class = " text-center small " colspan = " '. $first_colspan .' " >
'.tr(' _CONTRIBUTI_ ' , [
2019-03-01 15:30:54 +01:00
'_ACCONTO_' => $acconto ,
2019-07-12 12:40:13 +02:00
'_CONTRIBUTI_' => empty ( $documento -> ritenutaContributi ) ? null : $contributi ,
2024-03-22 15:52:24 +01:00
], [ 'upper' => true ]) . '
2017-12-20 14:05:14 +01:00
</ th > ' ;
2022-09-13 11:18:53 +02:00
}
2017-09-13 11:15:31 +02:00
2018-12-29 12:03:22 +01:00
echo '
2021-03-01 17:37:44 +01:00
< th class = " text-center small " colspan = " '. $second_colspan .' " >
'.(!$has_split_payment && !$has_sconto_finale ? $etichette[' totale_finale '] : $etichette[' totale_parziale ']).'
2018-12-28 18:03:38 +01:00
</ th > ' ;
2021-02-18 18:48:44 +01:00
echo '
2018-12-28 18:03:38 +01:00
</ tr >
2017-09-07 16:51:14 +02:00
2022-09-13 11:18:53 +02:00
< tr > ' ;
if ( ! empty ( $ritenuta_acconto_totale )) {
echo '
< td class = " cell-padded text-center " colspan = " '. $first_colspan .' " >
'.moneyFormat($ritenuta_acconto_totale, 2).'
</ td > ' ;
}
if ( ! empty ( $ritenuta_contributi_totale )) {
echo '
2017-12-20 14:05:14 +01:00
< td class = " cell-padded text-center " colspan = " '. $first_colspan .' " >
2022-09-13 11:18:53 +02:00
'.moneyFormat($ritenuta_contributi_totale, 2).'
2017-12-20 14:05:14 +01:00
</ td > ' ;
2022-09-13 11:18:53 +02:00
}
2017-12-20 14:05:14 +01:00
2022-09-13 11:18:53 +02:00
$totale = $totale - ( $ritenuta_acconto_totale + $ritenuta_contributi_totale );
2017-12-20 14:05:14 +01:00
echo '
2017-09-07 16:51:14 +02:00
2024-10-07 16:36:32 +02:00
< td class = " cell-padded text-center " colspan = " '. $second_colspan .' " style = " background-color:#77dd77; " >
< b > '.moneyFormat($totale, 2).' </ b >
2018-01-05 17:24:39 +01:00
</ td >
</ tr > ' ;
}
2021-03-01 17:37:44 +01:00
/*
* Riga di riepilogo per lo Split payment .
* Totale IVA | Totale ( + Rivalsa INPS - Ritenuta - Totale IVA )
*/
if ( $has_split_payment ) {
2024-10-15 15:43:51 +02:00
$first_colspan = 2 ;
$second_colspan = 1 ;
2018-12-29 12:03:22 +01:00
echo '
2018-12-28 18:03:38 +01:00
< tr >
< th class = " text-center small " colspan = " '. $first_colspan .' " >
2019-08-28 10:36:08 +02:00
'.tr(' IVA a carico del destinatario ', [], [' upper ' => true]).'
2018-12-28 18:03:38 +01:00
</ th >
< th class = " text-center small " colspan = " '. $second_colspan .' " >
2022-03-30 09:23:46 +02:00
'.(!$has_sconto_finale ? $etichette[' totale_finale '] : $etichette[' totale_parziale ']).'
2018-12-28 18:03:38 +01:00
</ th >
</ tr > ' ;
2021-03-01 17:37:44 +01:00
$totale = $totale - $totale_iva ;
2018-12-29 12:03:22 +01:00
echo '
2018-12-28 18:03:38 +01:00
< tr >
< td class = " cell-padded text-center " colspan = " '. $first_colspan .' " >
2019-08-28 10:36:08 +02:00
'.moneyFormat($totale_iva, 2).'
2018-12-28 18:03:38 +01:00
</ td >
2024-10-15 15:43:51 +02:00
< td class = " cell-padded text-center " colspan = " '. $second_colspan .' " style = " background-color:#77dd77; " >
< b > '.moneyFormat($totale, 2).' </ b >
2021-03-01 17:37:44 +01:00
</ td >
</ tr > ' ;
}
/*
2022-01-15 17:30:49 +01:00
* Riga di riepilogo per lo sconto in fattura .
* Sconto in | Totale ( + Rivalsa INPS - Ritenuta - Totale IVA [ se split payment ] - Sconto finale )
2021-03-01 17:37:44 +01:00
*/
if ( $has_sconto_finale ) {
$first_colspan = 1 ;
$second_colspan = 2 ;
echo '
< tr >
< th class = " text-center small " colspan = " '. $first_colspan .' " >
'.tr(' Sconto in fattura ', [], [' upper ' => true]).($documento->sconto_finale_percentuale ? ' ( '.numberFormat($documento->sconto_finale_percentuale, 2).' % ) ' : ' ').'
</ th >
< th class = " text-center small " colspan = " '. $second_colspan .' " >
'.tr(' Netto a pagare ', [], [' upper ' => true]).'
</ th >
</ tr > ' ;
$totale = $totale - $sconto_finale ;
echo '
< tr >
< td class = " cell-padded text-center " colspan = " '. $first_colspan .' " >
'.moneyFormat($sconto_finale, 2).'
</ td >
2024-10-02 13:08:45 +02:00
< td class = " cell-padded text-center " colspan = " '. $second_colspan .' " >
2021-03-01 17:37:44 +01:00
'.moneyFormat($totale, 2).'
2018-12-28 18:03:38 +01:00
</ td >
</ tr > ' ;
2017-09-07 16:51:14 +02:00
}
echo '
</ table > ' ;
2017-09-21 16:42:27 +02:00
if ( $fattura_accompagnatoria ) {
// Informazioni aggiuntive
echo '
< table class = " table-bordered " >
< tr >
2019-07-16 10:32:54 +02:00
< th class = " small " class style = " width:15% " >
'.tr(' Peso lordo ', [], [' upper ' => true]).'
</ th >
2019-07-16 10:34:51 +02:00
2019-07-16 10:32:54 +02:00
< th class = " small " class style = " width:15% " >
'.tr(' Volume ', [], [' upper ' => true]).'
</ th >
2019-07-16 10:34:51 +02:00
2019-07-16 10:32:54 +02:00
< th class = " small " class style = " width:15% " >
2017-09-21 16:42:27 +02:00
'.tr(' Aspetto beni ', [], [' upper ' => true]).'
</ th >
2019-07-16 10:32:54 +02:00
< th class = " small " class style = " width:10% " >
'.tr(' Colli ', [], [' upper ' => true]).'
2017-09-21 16:42:27 +02:00
</ th >
< th class = " small " style = " width:30% " >
'.tr(' Causale trasporto ', [], [' upper ' => true]).'
</ th >
2019-07-16 10:32:54 +02:00
< th class = " small " style = " width:15% " >
2017-09-21 16:42:27 +02:00
'.tr(' Porto ', [], [' upper ' => true]).'
</ th >
</ tr >
< tr >
2019-07-16 10:32:54 +02:00
< td class = " cell-padded " >
'.(!empty($peso_lordo) ? Translator::numberToLocale($peso_lordo).' & nbsp ; KG ' : ' ').'
</ td >
< td class = " cell-padded " >
'.(!empty($volume) ? Translator::numberToLocale($volume).' & nbsp ; M < sup > 3 </ sup > ' : ' ').'
</ td >
2019-07-16 10:34:51 +02:00
2017-09-21 16:42:27 +02:00
< td class = " cell-padded " >
$aspettobeni $ & nbsp ;
</ td >
< td class = " cell-padded " >
$n_colli $ & nbsp ;
</ td >
< td class = " cell-padded " >
$causalet $ & nbsp ;
</ td >
< td class = " cell-padded " >
$porto $ & nbsp ;
</ td >
</ tr >
</ table > ' ;
// Firme
echo '
< table class = " table-bordered " >
< tr >
< th class = " small " style = " width:33% " >
'.tr(' Tipo di spedizione ', [], [' upper ' => true]).'
</ th >
< th class = " small " style = " width:33% " >
'.tr(' Firma conducente ', [], [' upper ' => true]).'
</ th >
< th class = " small " style = " width:33% " >
'.tr(' Firma destinatario ', [], [' upper ' => true]).'
</ th >
</ tr >
< tr >
< td style = " height: 10mm " > $spedizione $ $vettore $ </ td >
< td style = " height: 10mm " ></ td >
< td style = " height: 10mm " ></ td >
</ tr >
</ table > ' ;
}
2017-09-07 16:51:14 +02:00
echo '
2020-07-20 14:52:09 +02:00
< div style = " font-size: 6pt; text-align: left; " class = " text-muted " >
2020-07-17 17:34:06 +02:00
< span > $dicitura_fissa_fattura $ </ span >
2020-03-21 21:14:25 +01:00
</ div > ' ;
2018-08-29 16:28:50 +02:00
2019-07-29 16:54:20 +02:00
if ( empty ( $options [ 'last-page-footer' ])) {
2018-09-03 16:49:43 +02:00
echo '$default_footer$' ;
2018-08-29 16:28:50 +02:00
}