From 1d0efdf6d31de86787c1421cc3e067f8256a3c0c Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Tue, 14 Nov 2023 10:48:04 +0100 Subject: [PATCH] Aggiunta stampa preventivo (solo totale imponibile) --- templates/preventivi/body.php | 112 ++++++++++++++++++++-------------- update/2_4_52.sql | 5 +- 2 files changed, 69 insertions(+), 48 deletions(-) diff --git a/templates/preventivi/body.php b/templates/preventivi/body.php index 0fe593f80..3c9eaf350 100755 --- a/templates/preventivi/body.php +++ b/templates/preventivi/body.php @@ -58,7 +58,7 @@ $has_image = $righe->search(function ($item) { return !empty($item->articolo->immagine); }) !== false && $options['images'] == true; -$columns = 6; +$columns = $options['no-iva'] ? 5 : 6; $columns = $options['pricing'] ? $columns : 3; if ($has_image) { @@ -170,8 +170,12 @@ echo " if ($options['pricing']) { echo " - ".tr('Prezzo unitario', [], ['upper' => true])." - ".tr('IVA', [], ['upper' => true])." (%) + ".tr('Prezzo unitario', [], ['upper' => true]).""; + if (!$options['no-iva']) { + echo" + ".tr('IVA', [], ['upper' => true])." (%)"; + } + echo" ".($options['hide-total'] ? tr('Importo ivato', [], ['upper' => true]) : tr('Importo', [], ['upper' => true])).''; } @@ -273,13 +277,13 @@ foreach ($righe as $key => $riga) { echo ' '; - - // Iva - echo ' - - '.Translator::numberToLocale($riga->aliquota->percentuale, 2).' - '; - + if (!$options['no-iva']) { + // Iva + echo ' + + '.Translator::numberToLocale($riga->aliquota->percentuale, 2).' + '; + } // Imponibile echo ' @@ -293,8 +297,11 @@ foreach ($righe as $key => $riga) { if ($options['pricing']) { echo ' - '; + if (!$options['no-iva']) { + echo' + '; + } } } } @@ -314,8 +321,9 @@ foreach ($righe as $key => $riga) { '.moneyFormat($subtotale_gruppo, 2).' - - + '; + if (!$options['no-iva']) { + echo' '.tr('Iva', [], ['upper' => true]).': @@ -324,16 +332,15 @@ foreach ($righe as $key => $riga) { '.moneyFormat($iva_gruppo, 2).' - - + '.tr('Subtotale ivato', [], ['upper' => true]).': '.moneyFormat($subtotale_gruppo + $iva_gruppo, 2).' '; - + } $autofill->next(); $autofill->next(); $autofill->next(); @@ -360,11 +367,11 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on // Totale imponibile echo ' - + '.tr('Imponibile', [], ['upper' => true]).': - + '.moneyFormat($show_sconto ? $imponibile : $totale_imponibile, 2).' '; @@ -396,56 +403,67 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on } // IVA - echo ' - - - '.tr('Totale IVA', [], ['upper' => true]).': - - - - '.moneyFormat($totale_iva, 2).' - - '; - - // TOTALE - echo ' - - - '.tr('Totale documento', [], ['upper' => true]).': - - - '.moneyFormat($totale, 2).' - - '; - - if ($sconto_finale) { - // SCONTO IN FATTURA + if (!$options['no-iva']) { echo ' - '.tr('Sconto in fattura', [], ['upper' => true]).': + '.tr('Totale IVA', [], ['upper' => true]).': + - '.moneyFormat($sconto_finale, 2).' + '.moneyFormat($totale_iva, 2).' '; - // NETTO A PAGARE + // TOTALE echo ' - '.tr('Netto a pagare', [], ['upper' => true]).': + '.tr('Totale documento', [], ['upper' => true]).': - '.moneyFormat($netto_a_pagare, 2).' + '.moneyFormat($totale, 2).' '; + + if ($sconto_finale) { + // SCONTO IN FATTURA + echo ' + + + '.tr('Sconto in fattura', [], ['upper' => true]).': + + + '.moneyFormat($sconto_finale, 2).' + + '; + + // NETTO A PAGARE + echo ' + + + '.tr('Netto a pagare', [], ['upper' => true]).': + + + '.moneyFormat($netto_a_pagare, 2).' + + '; + } } } echo ' '; + +if ($options['no-iva']) { + echo' +

+ Importo IVA esclusa +

+'; +} + // CONDIZIONI GENERALI DI FORNITURA echo ' diff --git a/update/2_4_52.sql b/update/2_4_52.sql index a11f12f9d..4010c384b 100644 --- a/update/2_4_52.sql +++ b/update/2_4_52.sql @@ -29,4 +29,7 @@ ORDER BY -- Serial in Contratti ALTER TABLE `mg_prodotti` ADD `id_riga_contratto` INT NULL AFTER `id_riga_intervento`; -ALTER TABLE `mg_prodotti` ADD FOREIGN KEY (`id_riga_contratto`) REFERENCES `co_righe_contratti`(`id`) ON DELETE CASCADE; \ No newline at end of file +ALTER TABLE `mg_prodotti` ADD FOREIGN KEY (`id_riga_contratto`) REFERENCES `co_righe_contratti`(`id`) ON DELETE CASCADE; + +-- Aggiunta stampa preventivo (solo totale imponibile) +INSERT INTO `zz_prints` (`id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`, `available_options`) VALUES ((SELECT `id` FROM `zz_modules` WHERE `name` = 'Preventivi'), '1', 'Preventivo(solo totale imponibile)', 'Preventivo (solo totale imponibile)', 'Preventivo num. {numero} del {data} rev {revisione}', 'preventivi', 'idpreventivo', '{\"pricing\": false, \"last-page-footer\": true, \"images\": true, \"no-iva\":true, \"show-only-total\":true }', 'fa fa-print', '', '', '0', '0', '1', '1', '{\"pricing\":\"Visualizzare i prezzi\", \"hide-total\": \"Nascondere i totali delle righe\", \"show-only-total\": \"Visualizzare solo i totali del documento\", \"hide-header\": \"Nascondere intestazione\", \"hide-footer\": \"Nascondere footer\", \"last-page-footer\": \"Visualizzare footer solo su ultima pagina\", \"hide-item-number\": \"Nascondere i codici degli articoli\"}'); \ No newline at end of file