]> _ Git - fluidbook-html5.git/commitdiff
#1966
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 8 Mar 2018 10:43:28 +0000 (11:43 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 8 Mar 2018 10:43:28 +0000 (11:43 +0100)
js/libs/fluidbook/special/wescosales.js

index 2c6b7f9f178f36d844fcaecac84d136c58df277b..8b79810c0e4d562ee4bf78df7077fdf40c9be751 100644 (file)
@@ -203,11 +203,18 @@ function getWescoRef(ref) {
 
                     var ca = null;
                     var hasCA = false;
-                    if (line0[i + 1] != undefined && line0[i + 1].toString().indexOf('CA ' + line0[i]) != -1) {
-                        ca = Math.round(parseFloat(line[i + 1])).toString();
+                    var colTitle = line0[i];
+                    var qte = line[i];
+                    if (colTitle.indexOf('Qté') == 0) {
+                        colTitle = line0[i].substr(4);
+                    }
+
+                    if (line0[i + 1] != undefined && line0[i].indexOf('Qté') == 0 && line0[i + 1].toString().indexOf('CA ' + colTitle) != -1) {
+                        qte = parseInt(line[i]).toLocaleString();
+                        ca = Math.round(parseFloat(line[i + 1])).toLocaleString();
                         hasCA = true;
                     }
-                    d.push([line0[i], line[i], ca]);
+                    d.push([colTitle, qte, ca]);
 
                     if (String(line0[i]).toLocaleLowerCase().indexOf('supp') >= 0 && line[i] !== null && String(line[i]) != '') {
                         res.del = line[i];