[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 02/20: Task #1187 - Problème avec la CA - to
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 02/20: Task #1187 - Problème avec la CA - totaux inégaux #0001187 : rounded problem |
Date: |
Sat, 24 Oct 2015 21:44:57 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 148f0279e1aa05b86bfb865c6f4bf24cc3632a36
Author: Dany De Bontridder <address@hidden>
Date: Fri Oct 23 12:23:12 2015 +0200
Task #1187 - Problème avec la CA - totaux inégaux
#0001187 : rounded problem
---
html/js/anc_script.js | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/html/js/anc_script.js b/html/js/anc_script.js
index 5087109..3e1351f 100644
--- a/html/js/anc_script.js
+++ b/html/js/anc_script.js
@@ -79,10 +79,12 @@ function compute_total_table(p_table, seq)
var i = 0;
var tot = 0;
var col = document.getElementsByName("val[" + seq + "][]");
+ var rounded_value = 0 ;
for (i = 0; i < col.length; i++)
{
if ( $(p_table).contains(col[i])) {
- tot += parseFloat(col[i].value);
+ rounded_value = parseFloat(col[i].value);
+ tot += Math.round(rounded_value*100)/100;
}
}
return tot;
@@ -156,6 +158,7 @@ function verify_ca(div)
total_amount += parseFloat(array_value[i].value);
}
var amount = Math.abs(parseFloat(g('amount_t' + idx).value));
+ amount = Math.round(amount*100)/100;
var diff = amount - total_amount;
if (Math.round(diff, 2) != 0.0)
@@ -282,6 +285,7 @@ function caod_checkTotal()
{
amount = 0.0;
}
+ amount = Math.round(amount*100)/100;
if (side.checked == false)
{
total_cred += amount;
- [Noalyss-commit] [noalyss] branch master updated (a6c7e8e -> 08827e1), Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 03/20: Documentation, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 04/20: Documentation, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 01/20: translation, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 06/20: translation, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 07/20: is_local_admin is deprecated and return always false, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 02/20: Task #1187 - Problème avec la CA - totaux inégaux #0001187 : rounded problem,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 08/20: security, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 09/20: security, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 05/20: translation, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 10/20: security, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 12/20: protect variable, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 11/20: security, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 13/20: protect variable, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 14/20: Round value , due to the 4 dec in Sale and Expense, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 17/20: After cloning a profil, show it and select the default tab, Dany De Bontridder, 2015/10/24
- [Noalyss-commit] [noalyss] 15/20: Menu : fix problem when cloning, Dany De Bontridder, 2015/10/24