From 5441da45512ec7394cc0127d382a649a6ce9ba3b Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 24 May 2018 12:51:09 +0200 Subject: [PATCH] Totali sommabili per le fatture e visualizzati in stampa datatables --- lib/functions.js | 11 +++++++++++ update/2_4_1.sql | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/lib/functions.js b/lib/functions.js index 12f2e624a..578ca940f 100644 --- a/lib/functions.js +++ b/lib/functions.js @@ -586,6 +586,16 @@ function start_datatables() { }, { extend: 'print', + customize: function ( win ) { + $(win.document.body) + .css( 'font-size', '10pt' ) + .append( + '
'+$('#summable').text()+'
', + ); + $(win.document.body).find( 'table' ) + .addClass( 'compact' ) + .css( 'font-size', 'inherit' ); + }, exportOptions: { modifier: { selected: true @@ -724,6 +734,7 @@ function start_datatables() { this.api().columns().every(function () { if (sum.summable[i] != undefined) { $(this.footer()).addClass("text-right"); + $(this.footer()).attr("id", "summable"); $(this.footer()).html(sum.summable[i]); } else $(this.footer()).html(" "); i++; diff --git a/update/2_4_1.sql b/update/2_4_1.sql index bf0756466..2b5d4bd1c 100644 --- a/update/2_4_1.sql +++ b/update/2_4_1.sql @@ -219,3 +219,7 @@ UPDATE `zz_files` SET `id_plugin` = NULL WHERE `id_plugin` = 0; -- Fix id_module (zz_files) ALTER TABLE `zz_files` CHANGE `id_module` `id_module` INT(11) NULL; UPDATE `zz_files` SET `id_module` = NULL WHERE `id_module` = 0; + +-- Totali fatture, sommabile +UPDATE `zz_views` SET `summable` = '1' WHERE `zz_views`.`id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Fatture di vendita') AND name = 'Totale'; +UPDATE `zz_views` SET `summable` = '1' WHERE `zz_views`.`id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Fatture di acquisto') AND name = 'Totale'; \ No newline at end of file