From bee5b6d12436f76fe6e7387302d0ce792ebf7662 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 22 Aug 2022 12:24:13 +1000 Subject: [PATCH] Display "on order" quantity in build order allocation table (#3585) --- InvenTree/templates/js/translated/build.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index 52359ef45e..41c3f5df47 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -1841,14 +1841,20 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { text += `${available_stock}`; } + var icons = ''; + if (available_stock < (required - allocated)) { - text += ``; + icons += ``; } else { - text += ``; + icons += ``; + } + + if (row.on_order && row.on_order > 0) { + icons += ``; } if (available_stock <= 0) { - text += `{% trans "No Stock Available" %}`; + icons += `{% trans "No Stock Available" %}`; } else { var extra = ''; if ((substitute_stock > 0) && (variant_stock > 0)) { @@ -1860,11 +1866,11 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { } if (extra) { - text += ``; + icons += ``; } } - return renderLink(text, url); + return renderLink(text, url) + icons; }, sorter: function(valA, valB, rowA, rowB) {