]> _ Git - fluidbook-html5.git/commitdiff
wait #4497 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 31 May 2021 15:52:18 +0000 (17:52 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 31 May 2021 15:52:18 +0000 (17:52 +0200)
js/libs/fluidbook/fluidbook.stats.js
js/libs/fluidbook/special/wescosales.js

index 52fba07dee668a3d6ede121879ed664d091fab92..d5f6c623b5982b74fe0082eecc073ce58a8deae5 100644 (file)
@@ -186,7 +186,6 @@ FluidbookStats.prototype = {
                 dl.eventLabel = a3;\r
                 dl.eventAction = a2;\r
             }\r
-            console.log('datalayer', dl);\r
             dataLayer.push(dl);\r
         } else if (this.ga === 'gtag') {\r
             var f, o, c, a;\r
index bbf8193eec5b7cccbf59413c3591831eb7dc48c0..cf7ac6d7f25bcca73d06a7c2b7045269c8a39f25 100644 (file)
@@ -118,8 +118,8 @@ function setWescoSalesPanel(ref, e, updateOnly) {
                 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]);
             }
         }
     });
@@ -137,11 +137,11 @@ function setWescoSalesPanel(ref, e, updateOnly) {
     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>';
@@ -168,6 +168,10 @@ function setWescoSalesPanel(ref, e, updateOnly) {
     setInteractPanel(id, updateOnly);
 }
 
+function wescoParseNumber(n){
+    return parseInt(n.toString().replace(/,/g, ''));
+}
+
 function getAllRefs() {
     if (allrefs === null) {
         var res = [];