From e055902f3e398c731e6a4c0a8726d6a402bc8773 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 6 Oct 2021 16:58:00 +1100 Subject: [PATCH] More JS linting --- InvenTree/templates/js/translated/order.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/InvenTree/templates/js/translated/order.js b/InvenTree/templates/js/translated/order.js index f5d9117cbf..c6e5ebf94b 100644 --- a/InvenTree/templates/js/translated/order.js +++ b/InvenTree/templates/js/translated/order.js @@ -1234,7 +1234,7 @@ function showAllocationSubTable(index, row, element, options) { html += makeIconButton('fa-trash-alt icon-red', 'button-allocation-delete', pk, '{% trans "Delete stock allocation" %}'); } - html += ""; + html += ''; return html; }, @@ -1367,8 +1367,8 @@ function loadSalesOrderLineItemTable(table, options={}) { return '-'; } }, - footerFormatter: function() { - return '{% trans "Total" %}' + footerFormatter: function() { + return '{% trans "Total" %}'; }, }, { @@ -1382,11 +1382,11 @@ function loadSalesOrderLineItemTable(table, options={}) { field: 'quantity', title: '{% trans "Quantity" %}', footerFormatter: function(data) { - return data.map(function (row) { - return +row['quantity'] - }).reduce(function (sum, i) { - return sum + i - }, 0) + return data.map(function(row) { + return +row['quantity']; + }).reduce(function(sum, i) { + return sum + i; + }, 0); }, switchable: false, }, @@ -1410,12 +1410,13 @@ function loadSalesOrderLineItemTable(table, options={}) { currency: row.sale_price_currency } ); + return formatter.format(total); }, footerFormatter: function(data) { - var total = data.map(function (row) { + var total = data.map(function(row) { return +row['sale_price'] * row['quantity']; - }).reduce(function (sum, i) { + }).reduce(function(sum, i) { return sum + i; }, 0);