mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
If a part has no stock but is on order, display an "on-order" badge
This commit is contained in:
parent
dae45875fb
commit
99efbd4c40
@ -182,17 +182,27 @@ function loadPartTable(table, url, options={}) {
|
||||
searchable: false,
|
||||
sortable: true,
|
||||
formatter: function(value, row, index, field) {
|
||||
console.log("On order:", row.on_order);
|
||||
|
||||
var html = "";
|
||||
var link = "stock";
|
||||
|
||||
if (value) {
|
||||
|
||||
if (row.units) {
|
||||
value += ' <i><small>' + row.units + '</small></i>';
|
||||
}
|
||||
|
||||
return renderLink(value, '/part/' + row.pk + '/stock/');
|
||||
}
|
||||
else {
|
||||
return "<span class='label label-warning'>No Stock</span>";
|
||||
html = value;
|
||||
|
||||
} else if (row.on_order) {
|
||||
value = "<span class='label label-primary'>On Order : " + row.on_order + "</span>";
|
||||
link = "orders";
|
||||
} else {
|
||||
value ="<span class='label label-warning'>No Stock</span>";
|
||||
}
|
||||
|
||||
return renderLink(value, '/part/' + row.pk + "/" + link + "/");
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user