diff --git a/InvenTree/templates/js/translated/bom.js b/InvenTree/templates/js/translated/bom.js index 1e384bf734..6591068e9d 100644 --- a/InvenTree/templates/js/translated/bom.js +++ b/InvenTree/templates/js/translated/bom.js @@ -808,13 +808,12 @@ function loadBomTable(table, options={}) { // Calculate total "available" (unallocated) quantity var total = row.available_stock + row.available_substitute_stock; - // var text = row.available_substitute_stock + row.available_stock; + + var text = `${total}`; if (total <= 0) { text = `{% trans "No Stock Available" %}`; } else { - text = `${total}`; - if (row.available_substitute_stock > 0) { text += ``; } diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index d4db965ebd..ff1f475d5d 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -1421,9 +1421,24 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { sortable: true, }, { - field: 'sub_part_detail.stock', + field: 'available_stock', title: '{% trans "Available" %}', sortable: true, + formatter: function(value, row) { + var total = row.available_stock + row.available_substitute_stock; + + var text = `${total}`; + + if (total <= 0) { + text = `{% trans "No Stock Available" %}`; + } else { + if (row.available_substitute_stock > 0) { + text += ``; + } + } + + return text; + } }, { field: 'allocated',