if (wlines[d[0]] == null || wlines[d[0]] == undefined) {
wlines[d[0]] = {ca: 0, qte: 0};
}
- wlines[d[0]].ca += parseInt(d[1].toString().replace(/,/g, ''));
- wlines[d[0]].qte += parseInt(d[2].toString().replace(/,/g, ''));
+ wlines[d[0]].ca += wescoParseNumber(d[1]);
+ wlines[d[0]].qte += wescoParseNumber(d[2]);
}
}
});
w += '<table>';
w += '<tr><th></th><th>Qté</th><th>CA</th></tr>';
- var format = new Intl.NumberFormat('en-US');
+ var format = new Intl.NumberFormat('fr-FR');
$.each(wlines, function (date, line) {
- var ca = unique ? line.ca : format.format(line.ca);
- var qte = unique ? line.qte : format.format(line.qte);
+ var ca = unique && line.ca.match(/[^0-9, .]/) ? line.ca : format.format(wescoParseNumber(line.ca));
+ var qte = unique && line.qte.match(/[^0-9, .]/) ? line.qte : format.format(wescoParseNumber(line.qte));
w += '<tr>';
w += '<td class="d">' + date + '</td>';
w += '<td class="v">' + ca + '</td>';
setInteractPanel(id, updateOnly);
}
+function wescoParseNumber(n){
+ return parseInt(n.toString().replace(/,/g, ''));
+}
+
function getAllRefs() {
if (allrefs === null) {
var res = [];