Aggiunte opzioni possibli stampa Contratto

This commit is contained in:
Luca 2024-05-14 16:51:20 +02:00
parent 967b57999d
commit 9b745228c6
2 changed files with 56 additions and 44 deletions

View File

@ -271,15 +271,15 @@ $netto_a_pagare = $documento->netto;
$show_sconto = $sconto > 0; $show_sconto = $sconto > 0;
// TOTALE COSTI FINALI // TOTALE COSTI FINALI
if ($options['pricing']) { if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-only-total']) {
// Totale imponibile // Totale imponibile
echo ' echo '
<tr> <tr>
<td colspan="3" class="text-right border-top"> <td colspan="' . ($options['show-only-total'] ? (($has_image) ? 3 : 2) : 4) . '" class="text-right border-top">
<b>'.tr('Imponibile', [], ['upper' => true]).':</b> <b>'.tr('Imponibile', [], ['upper' => true]). ':</b>
</td> </td>
<th colspan="2" class="text-right"> <th colspan="' . ($options['show-only-total'] ? (($has_image) ? ($options['no-iva'] ? 1 : 2) : 1) : (($has_image) ? 3 : 2)) . '" class="text-right">
<b>'.moneyFormat($show_sconto ? $imponibile : $totale_imponibile, $d_totali).'</b> <b>'.moneyFormat($show_sconto ? $imponibile : $totale_imponibile, $d_totali).'</b>
</th> </th>
</tr>'; </tr>';
@ -288,11 +288,11 @@ if ($options['pricing']) {
if ($show_sconto) { if ($show_sconto) {
echo ' echo '
<tr> <tr>
<td colspan="3" class="text-right border-top"> <td colspan="' . ($options['show-only-total'] ? 2 : 4) . '" class="text-right border-top">
<b>'.tr('Sconto', [], ['upper' => true]).':</b> <b>'.tr('Sconto', [], ['upper' => true]). ':</b>
</td> </td>
<th colspan="2" class="text-right"> <th colspan="' . ($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)) . '" class="text-right">
<b>'.moneyFormat($sconto, $d_totali).'</b> <b>'.moneyFormat($sconto, $d_totali).'</b>
</th> </th>
</tr>'; </tr>';
@ -300,66 +300,77 @@ if ($options['pricing']) {
// Totale imponibile // Totale imponibile
echo ' echo '
<tr> <tr>
<td colspan="3" class="text-right border-top"> <td colspan="' . ($options['show-only-total'] ? 2 : 4) . '" class="text-right border-top">
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b> <b>'.tr('Totale imponibile', [], ['upper' => true]). ':</b>
</td> </td>
<th colspan="2" class="text-right"> <th colspan="' . ($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)) . '" class="text-right">
<b>'.moneyFormat($totale_imponibile, $d_totali).'</b> <b>'.moneyFormat($totale_imponibile, $d_totali).'</b>
</th> </th>
</tr>'; </tr>';
} }
if (!$options['no-iva']) {
// IVA // IVA
echo '
<tr>
<td colspan="3" class="text-right border-top">
<b>'.tr('Totale IVA', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-right">
<b>'.moneyFormat($totale_iva, $d_totali).'</b>
</th>
</tr>';
// TOTALE
echo '
<tr>
<td colspan="3" class="text-right border-top">
<b>'.tr('Totale documento', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-right">
<b>'.moneyFormat($totale, $d_totali).'</b>
</th>
</tr>';
if ($sconto_finale) {
// SCONTO IN FATTURA
echo ' echo '
<tr> <tr>
<td colspan="3" class="text-right border-top"> <td colspan="' . ($options['show-only-total'] ? 2 : 4) . '" class="text-right border-top">
<b>'.tr('Sconto in fattura', [], ['upper' => true]).':</b> <b>'.tr('Totale IVA', [], ['upper' => true]). ':</b>
</td> </td>
<th colspan="2" class="text-right">
<b>'.moneyFormat($sconto_finale, $d_totali).'</b> <th colspan="' . ($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)) . '" class="text-right">
<b>'.moneyFormat($totale_iva, $d_totali).'</b>
</th> </th>
</tr>'; </tr>';
// NETTO A PAGARE // TOTALE
echo ' echo '
<tr> <tr>
<td colspan="3" class="text-right border-top"> <td colspan="' . ($options['show-only-total'] ? 2 : 4) . '" class="text-right border-top">
<b>'.tr('Netto a pagare', [], ['upper' => true]).':</b> <b>'.tr('Totale documento', [], ['upper' => true]).':</b>
</td> </td>
<th colspan="2" class="text-right"> <th colspan="2" class="text-right">
<b>'.moneyFormat($netto_a_pagare, $d_totali).'</b> <b>'.moneyFormat($totale, $d_totali).'</b>
</th> </th>
</tr>'; </tr>';
if ($sconto_finale) {
// SCONTO IN FATTURA
echo '
<tr>
<td colspan="' . ($options['show-only-total'] ? 2 : 4) . '" class="text-right border-top">
<b>'.tr('Sconto in fattura', [], ['upper' => true]). ':</b>
</td>
<th colspan="' . ($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)) . '" class="text-right">
<b>'.moneyFormat($sconto_finale, $d_totali).'</b>
</th>
</tr>';
// NETTO A PAGARE
echo '
<tr>
<td colspan="' . ($options['show-only-total'] ? 2 : 4) . '" class="text-right border-top">
<b>'.tr('Netto a pagare', [], ['upper' => true]). ':</b>
</td>
<th colspan="' . ($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)) . '" class="text-right">
<b>'.moneyFormat($netto_a_pagare, $d_totali).'</b>
</th>
</tr>';
}
} }
} }
echo ' echo '
</table>'; </table>';
if ($options['no-iva']) {
echo '
<p colspan="3" class="text-right text-muted">
<small>Importo IVA esclusa</small>
</p>
';
}
// CONDIZIONI GENERALI DI FORNITURA // CONDIZIONI GENERALI DI FORNITURA
$pagamento = Pagamento::find($documento['idpagamento']); $pagamento = Pagamento::find($documento['idpagamento']);

View File

@ -419,6 +419,7 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on
<td colspan="'.($options['show-only-total'] ? 2 : 4).'" class="text-right border-top"> <td colspan="'.($options['show-only-total'] ? 2 : 4).'" class="text-right border-top">
<b>'.tr('Totale documento', [], ['upper' => true]).':</b> <b>'.tr('Totale documento', [], ['upper' => true]).':</b>
</td> </td>
<th colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)).'" class="text-right"> <th colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)).'" class="text-right">
<b>'.moneyFormat($totale, $d_totali).'</b> <b>'.moneyFormat($totale, $d_totali).'</b>
</th> </th>