From 15c9a0ca3a4e0b82c2a8cd5b3a6e86d9eb2a06c0 Mon Sep 17 00:00:00 2001 From: Fabio Lovato Date: Wed, 21 Mar 2018 17:07:39 +0100 Subject: [PATCH] Corretto problema calcolo sbilancio in JS su prima nota --- modules/primanota/add.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/primanota/add.php b/modules/primanota/add.php index 2801d86b1..d9e5b8c23 100644 --- a/modules/primanota/add.php +++ b/modules/primanota/add.php @@ -278,19 +278,19 @@ include_once __DIR__.'/../../core.php'; $('input[id*=dare]').each( function(){ if( $(this).val() == '' ) valore = 0; else valore = $(this).val().toEnglish(); - totale_dare += valore; + totale_dare += Math.round(valore*100)/100; }); $('input[id*=avere]').each( function(){ if( $(this).val() == '' ) valore = 0; else valore = $(this).val().toEnglish(); - totale_avere += valore; + totale_avere += Math.round(valore*100)/100; }); $('#totale_dare').text(totale_dare.toLocale()); $('#totale_avere').text(totale_avere.toLocale()); - bilancio = totale_dare - totale_avere; + bilancio = Math.round(totale_dare*100)/100 - Math.round(totale_avere*100)/100; if(bilancio == 0){ $("#testo_aggiuntivo").removeClass('text-danger').html("");