From 4e1b9efe93971c8e50edfab59eece159d05545a9 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 19 Nov 2019 09:08:17 +1100 Subject: [PATCH] Fix javascript rendering of decimal quantity in BOM table --- InvenTree/InvenTree/static/script/inventree/bom.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/InvenTree/InvenTree/static/script/inventree/bom.js b/InvenTree/InvenTree/static/script/inventree/bom.js index 97dca94017..e62c8c22f4 100644 --- a/InvenTree/InvenTree/static/script/inventree/bom.js +++ b/InvenTree/InvenTree/static/script/inventree/bom.js @@ -163,21 +163,16 @@ function loadBomTable(table, options) { formatter: function(value, row, index, field) { var text = value; + // The 'value' is a text string with (potentially) multiple trailing zeros + // Let's make it a bit more pretty + text = parseFloat(text); + if (row.overage) { text += " (+" + row.overage + ") "; } return text; }, - footerFormatter: function(data) { - var quantity = 0; - - data.forEach(function(item) { - quantity += item.quantity; - }); - - return quantity; - }, }); if (!options.editable) {