From 24fd520ec3225c76c5b36c64b79c6a92e047d90c Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 18 Nov 2020 15:03:51 +1100 Subject: [PATCH] Smallt tweaks for the Stock table --- InvenTree/InvenTree/status_codes.py | 1 + InvenTree/templates/js/stock.js | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/InvenTree/InvenTree/status_codes.py b/InvenTree/InvenTree/status_codes.py index b527009ede..1d5335ad2f 100644 --- a/InvenTree/InvenTree/status_codes.py +++ b/InvenTree/InvenTree/status_codes.py @@ -182,6 +182,7 @@ class StockStatus(StatusCode): ATTENTION: 'yellow', DAMAGED: 'red', DESTROYED: 'red', + LOST: 'grey', REJECTED: 'red', } diff --git a/InvenTree/templates/js/stock.js b/InvenTree/templates/js/stock.js index e59bf5d469..da57d4f048 100644 --- a/InvenTree/templates/js/stock.js +++ b/InvenTree/templates/js/stock.js @@ -536,13 +536,17 @@ function loadStockTable(table, options) { // Special stock status codes - // 65 = "REJECTED" - if (row.status == 65) { - html += makeIconButton('fa-times-circle icon-red', '{% trans "Stock item has been rejected" %}'); + // REJECTED + if (row.status == {{ StockStatus.REJECTED }}) { + console.log("REJECTED - {{ StockStatus.REJECTED }}"); + html += makeIconBadge('fa-times-circle icon-red', '{% trans "Stock item has been rejected" %}'); } - // 70 = "LOST" - else if (row.status == 70) { - html += makeIconButton('fa-question-circle','{% trans "Stock item is lost" %}'); + // LOST + else if (row.status == {{ StockStatus.LOST }}) { + html += makeIconBadge('fa-question-circle','{% trans "Stock item is lost" %}'); + } + else if (row.status == {{ StockStatus.DESTROYED }}) { + html += makeIconBadge('fa-skull-crossbones', '{% trans "Stock item is destroyed" %}'); } if (row.quantity <= 0) {