From 2cffe46e01f1cbef1c0922553cafb8d77832f0d2 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 18 Feb 2019 21:57:16 +0100 Subject: [PATCH] =?UTF-8?q?Mantis=20#0001651:=20Probl=C3=A8me=20avec=20tot?= =?UTF-8?q?aux=20en=20CA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/js/anc_script.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/html/js/anc_script.js b/html/js/anc_script.js index 97e524de2..9e2b7a3fb 100644 --- a/html/js/anc_script.js +++ b/html/js/anc_script.js @@ -83,11 +83,11 @@ function compute_total_table(p_table, seq) for (i = 0; i < col.length; i++) { if ( $(p_table).contains(col[i])) { - rounded_value = parseFloat(col[i].value); - tot += Math.round(rounded_value*100)/100; + rounded_value = Math.round(parseFloat(col[i].value) *100); + tot += rounded_value } } - return tot; + return tot/100; } catch (e) { @@ -106,6 +106,7 @@ function anc_refresh_remain(p_table, p_seq) { var tot_line =Math.abs( parseFloat(g('amount_t' + p_seq).value)); var tot_table = compute_total_table(p_table, p_seq); + var remain = tot_line - tot_table; remain = Math.round(remain * 100) / 100; $('remain' + p_table).innerHTML = remain;