Corretto problema calcolo sbilancio in JS su prima nota

This commit is contained in:
Fabio Lovato 2018-03-21 17:07:39 +01:00
parent 8f8b4b3b18
commit 15c9a0ca3a
1 changed files with 3 additions and 3 deletions

View File

@ -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("");