From 3c013380df8060214f95fc8e6cb41d8a23f90f84 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 14 May 2024 16:29:55 +0200 Subject: [PATCH 1/5] Migliorie minori --- modules/stampe/edit.php | 2 +- modules/stato_servizi/elenco-sessioni.php | 2 +- modules/stato_servizi/widgets/spazio_utilizzato.php | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/stampe/edit.php b/modules/stampe/edit.php index 6a4677838..e6d6f7313 100755 --- a/modules/stampe/edit.php +++ b/modules/stampe/edit.php @@ -55,7 +55,7 @@ $id_files = $dbo->select('zz_files_print', 'id_file', [], ['id_print' => $id_rec
- {[ "type": "select", "multiple": "1", "label": "", "name": "id_files[]", "value": "", "ajax-source": "allegati", "select-options": $id_module, 'id_record' => $id_record]); ?>, "link": "allegato" ]} + {[ "type": "select", "multiple": "1", "label": "", "name": "id_files[]", "value": "", "help": "", "ajax-source": "allegati", "select-options": $id_module, 'id_record' => $id_record]); ?>, "link": "allegato" ]}
diff --git a/modules/stato_servizi/elenco-sessioni.php b/modules/stato_servizi/elenco-sessioni.php index 945c37b75..666b599e2 100644 --- a/modules/stato_servizi/elenco-sessioni.php +++ b/modules/stato_servizi/elenco-sessioni.php @@ -93,5 +93,5 @@ if (setting('Attiva notifica di presenza utenti sul record')) { '; } else { - echo 'Non è possibile monitorare la presenta degli utenti.'; + echo ''.tr('Non è possibile monitorare la presenta degli utenti, attiva l\'impostazione di notifica di presenza utenti sul record').'.'; } diff --git a/modules/stato_servizi/widgets/spazio_utilizzato.php b/modules/stato_servizi/widgets/spazio_utilizzato.php index 735876a15..d4ca7b1ee 100755 --- a/modules/stato_servizi/widgets/spazio_utilizzato.php +++ b/modules/stato_servizi/widgets/spazio_utilizzato.php @@ -36,7 +36,7 @@ $(document).ready(function() { url: globals.rootdir + "/actions.php", type: "get", data: { - id_module: '.$id_module.', + id_module: '.$id_module. ', op: "sizes", }, success: function(data) { @@ -90,17 +90,16 @@ function crea_grafico(values){ } - - $labels.push(element.description + " (" + element.formattedSize + ")" + " [" + element.count + "]" ) - - + }); options = { + responsive: true, + maintainAspectRatio: false, legend: { display: true, - position: "right" + position: "right", }, animation:{ animateScale: true, @@ -164,6 +163,6 @@ function crea_grafico(values){ }
-
+
'; From bf3a0a22ea3cf875ae027e6ad31175c18c954977 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 14 May 2024 16:36:45 +0200 Subject: [PATCH 2/5] Rimossa variabile inutilizzata $is_last_page --- src/Prints.php | 2 -- templates/contratti/footer.php | 2 +- templates/ddt/footer.php | 2 +- templates/fatture/footer.php | 2 +- templates/preventivi/footer.php | 2 +- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Prints.php b/src/Prints.php index 9e7a1cb2e..720cf56a8 100755 --- a/src/Prints.php +++ b/src/Prints.php @@ -653,8 +653,6 @@ class Prints // Footer per l'ultima pagina if (!empty($options['last-page-footer'])) { - $is_last_page = true; - // Generazione dei contenuti del footer ob_start(); $print_footer = self::filepath($id_print, 'footer.php'); diff --git a/templates/contratti/footer.php b/templates/contratti/footer.php index 81623bfaf..bc7ca6a50 100755 --- a/templates/contratti/footer.php +++ b/templates/contratti/footer.php @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -if (!$is_last_page) { +if (!empty($options['last-page-footer'])) { return; } diff --git a/templates/ddt/footer.php b/templates/ddt/footer.php index 360ba91f5..51e90840c 100755 --- a/templates/ddt/footer.php +++ b/templates/ddt/footer.php @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -if (!empty($options['last-page-footer']) && !$is_last_page) { +if (!empty($options['last-page-footer'])) { return; } diff --git a/templates/fatture/footer.php b/templates/fatture/footer.php index 6606f981f..0389fa5cd 100755 --- a/templates/fatture/footer.php +++ b/templates/fatture/footer.php @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -if (!empty($options['last-page-footer']) && !$is_last_page) { +if (!empty($options['last-page-footer'])) { return; } diff --git a/templates/preventivi/footer.php b/templates/preventivi/footer.php index 81623bfaf..bc7ca6a50 100755 --- a/templates/preventivi/footer.php +++ b/templates/preventivi/footer.php @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -if (!$is_last_page) { +if (!empty($options['last-page-footer'])) { return; } From 967b57999d689c3968b11f92e4eddca57baf3351 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 14 May 2024 16:41:45 +0200 Subject: [PATCH 3/5] Opzioni possibili per stampa "Contratto" --- update/2_4_42.sql | 1 + update/2_5_2.sql | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/update/2_4_42.sql b/update/2_4_42.sql index f6855442f..5d1ebb573 100644 --- a/update/2_4_42.sql +++ b/update/2_4_42.sql @@ -10,6 +10,7 @@ UPDATE `zz_widgets` SET `class` = NULL; -- Aggiunto available_options per zz_prints ALTER TABLE `zz_prints` ADD `available_options` TEXT NULL AFTER `enabled`; +-- Opzioni possibili per stampa "Preventivo" UPDATE `zz_prints` SET `available_options` = '{\"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\"}' WHERE `zz_prints`.`name` = 'Preventivo'; UPDATE `zz_prints` SET `options` = '{\"pricing\": true, \"last-page-footer\": true, \"hide-item-number\": true}' WHERE `zz_prints`.`name` = 'Ordine cliente (senza codici)'; diff --git a/update/2_5_2.sql b/update/2_5_2.sql index 80fb7c7ce..bb0cdbb38 100644 --- a/update/2_5_2.sql +++ b/update/2_5_2.sql @@ -159,4 +159,8 @@ WHERE HAVING 2=2 ORDER BY - `matricola`" WHERE `name` = 'Impianti'; \ No newline at end of file + `matricola`" WHERE `name` = 'Impianti'; + + +-- Opzioni possibili per stampa del Contratto +UPDATE `zz_prints` SET `available_options` = '{\"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\"}' WHERE `zz_prints`.`name` = 'Contratto'; \ No newline at end of file From 9b745228c63c69c32eda480d329f9f8928e61831 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 14 May 2024 16:51:20 +0200 Subject: [PATCH 4/5] Aggiunte opzioni possibli stampa Contratto --- templates/contratti/body.php | 99 +++++++++++++++++++---------------- templates/preventivi/body.php | 1 + 2 files changed, 56 insertions(+), 44 deletions(-) diff --git a/templates/contratti/body.php b/templates/contratti/body.php index 6a5c62347..fb134a4b8 100755 --- a/templates/contratti/body.php +++ b/templates/contratti/body.php @@ -271,15 +271,15 @@ $netto_a_pagare = $documento->netto; $show_sconto = $sconto > 0; // TOTALE COSTI FINALI -if ($options['pricing']) { +if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-only-total']) { // Totale imponibile echo ' - - '.tr('Imponibile', [], ['upper' => true]).': + + '.tr('Imponibile', [], ['upper' => true]). ': - + '.moneyFormat($show_sconto ? $imponibile : $totale_imponibile, $d_totali).' '; @@ -288,11 +288,11 @@ if ($options['pricing']) { if ($show_sconto) { echo ' - - '.tr('Sconto', [], ['upper' => true]).': + + '.tr('Sconto', [], ['upper' => true]). ': - + '.moneyFormat($sconto, $d_totali).' '; @@ -300,66 +300,77 @@ if ($options['pricing']) { // Totale imponibile echo ' - - '.tr('Totale imponibile', [], ['upper' => true]).': + + '.tr('Totale imponibile', [], ['upper' => true]). ': - + '.moneyFormat($totale_imponibile, $d_totali).' '; } - - // IVA - echo ' - - - '.tr('Totale IVA', [], ['upper' => true]).': - - - - '.moneyFormat($totale_iva, $d_totali).' - - '; - - // TOTALE - echo ' - - - '.tr('Totale documento', [], ['upper' => true]).': - - - '.moneyFormat($totale, $d_totali).' - - '; - - if ($sconto_finale) { - // SCONTO IN FATTURA + if (!$options['no-iva']) { + // IVA echo ' - - '.tr('Sconto in fattura', [], ['upper' => true]).': + + '.tr('Totale IVA', [], ['upper' => true]). ': - - '.moneyFormat($sconto_finale, $d_totali).' + + + '.moneyFormat($totale_iva, $d_totali).' '; - // NETTO A PAGARE + // TOTALE echo ' - - '.tr('Netto a pagare', [], ['upper' => true]).': + + '.tr('Totale documento', [], ['upper' => true]).': + - '.moneyFormat($netto_a_pagare, $d_totali).' + '.moneyFormat($totale, $d_totali).' '; + + if ($sconto_finale) { + // SCONTO IN FATTURA + echo ' + + + '.tr('Sconto in fattura', [], ['upper' => true]). ': + + + '.moneyFormat($sconto_finale, $d_totali).' + + '; + + // NETTO A PAGARE + echo ' + + + '.tr('Netto a pagare', [], ['upper' => true]). ': + + + '.moneyFormat($netto_a_pagare, $d_totali).' + + '; + } } } echo ' '; +if ($options['no-iva']) { + echo ' +

+ Importo IVA esclusa +

+'; +} + + // CONDIZIONI GENERALI DI FORNITURA $pagamento = Pagamento::find($documento['idpagamento']); diff --git a/templates/preventivi/body.php b/templates/preventivi/body.php index 0e3c103b1..325d96625 100755 --- a/templates/preventivi/body.php +++ b/templates/preventivi/body.php @@ -419,6 +419,7 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on '.tr('Totale documento', [], ['upper' => true]).': + '.moneyFormat($totale, $d_totali).' From 18adb9e379f641f52b542721d380f3cf9c07af5b Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 14 May 2024 17:09:49 +0200 Subject: [PATCH 5/5] Aggiornamento stampa del contratto --- templates/contratti/body.php | 61 +++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/templates/contratti/body.php b/templates/contratti/body.php index fb134a4b8..91fbc9cae 100755 --- a/templates/contratti/body.php +++ b/templates/contratti/body.php @@ -24,8 +24,20 @@ include_once __DIR__.'/../../core.php'; $prezzi_ivati = setting('Utilizza prezzi di vendita comprensivi di IVA'); +// Righe documento +$righe = $documento->getRighe(); + +$has_image = $righe->search(fn ($item) => !empty($item->articolo->immagine)) !== false && $options['images'] == true; + +$columns = $options['no-iva'] ? 5 : 6; +$columns = $options['pricing'] ? $columns : 3; + +if ($has_image) { + ++$columns; +} + // Creazione righe fantasma -$autofill = new Util\Autofill($options['pricing'] ? 4 : 2); +$autofill = new Util\Autofill($columns); $autofill->setRows(20, 10); echo ' @@ -111,13 +123,26 @@ echo " + "; + +if ($has_image) { + echo " + "; +} + +echo " '; if ($options['pricing']) { echo " - - '; + '; + if (!$options['no-iva']) { + echo " + '; + } + echo " + '; } echo ' @@ -126,8 +151,8 @@ echo ' '; -// Righe documento -$righe = $documento->getRighe(); + + if (!setting('Visualizza riferimento su ogni riga in stampa')) { $riferimenti = []; @@ -147,15 +172,37 @@ if (!setting('Visualizza riferimento su ogni riga in stampa')) { } } } - +$num = 0; foreach ($righe as $riga) { + ++$num; $r = $riga->toArray(); $autofill->count($r['descrizione']); - echo ' + echo + ' + '; + + if ($has_image) { + if ($riga->isArticolo() && !empty($riga->articolo->image)) { + echo ' + '; + + $autofill->set(5); + } else { + echo ' + '; + } + } + +echo '
#Foto".tr('Descrizione', [], ['upper' => true])." ".tr('Q.tà', [], ['upper' => true]).'".tr('Prezzo unitario', [], ['upper' => true])."".tr('Imponibile', [], ['upper' => true]).'" . tr('Prezzo unitario', [], ['upper' => true]) . '" . tr('IVA', [], ['upper' => true]) . ' (%)" . ($options['hide-total'] ? tr('Importo ivato', [], ['upper' => true]) : tr('Importo', [], ['upper' => true])) . '
+ ' . $num . ' + + + '; + $text = ''; foreach ($riferimenti as $key => $riferimento) {