mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 05:26:45 +00:00
Display sub-location information
This commit is contained in:
parent
7120b940f0
commit
4011d66b6f
11
InvenTree/static/css/bootstrap-table-group-by.css
vendored
Normal file
11
InvenTree/static/css/bootstrap-table-group-by.css
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
.bootstrap-table .table > tbody > tr.groupBy {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bootstrap-table .table > tbody > tr.groupBy.expanded {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.bootstrap-table .table > tbody > tr.hidden + tr.detail-view {
|
||||||
|
display: none;
|
||||||
|
}
|
@ -153,7 +153,7 @@
|
|||||||
var cell = '<td>';
|
var cell = '<td>';
|
||||||
|
|
||||||
if (typeof that.options.groupByFormatter == 'function') {
|
if (typeof that.options.groupByFormatter == 'function') {
|
||||||
cell += that.options.groupByFormatter(col.title, item.id, item.data);
|
cell += '<i>' + that.options.groupByFormatter(col.title, item.id, item.data) + "</i>";
|
||||||
}
|
}
|
||||||
|
|
||||||
cell += "</td>";
|
cell += "</td>";
|
||||||
@ -177,7 +177,7 @@
|
|||||||
|
|
||||||
if(item.data.length > 1) {
|
if(item.data.length > 1) {
|
||||||
|
|
||||||
that.$body.find('tr[data-parent-index=' + item.id + ']').addClass('hidden');
|
that.$body.find('tr[data-parent-index=' + item.id + ']').addClass('hidden stock-sub-group');
|
||||||
|
|
||||||
that.$body.find('tr[data-parent-index=' + item.id + ']:first').before($(html.join('')));
|
that.$body.find('tr[data-parent-index=' + item.id + ']:first').before($(html.join('')));
|
||||||
}
|
}
|
||||||
|
@ -404,9 +404,25 @@ function loadStockTable(table, options) {
|
|||||||
stock += item.quantity;
|
stock += item.quantity;
|
||||||
});
|
});
|
||||||
|
|
||||||
return stock;
|
return stock + ' <i>(' + data.length + ' items)</i>';
|
||||||
}
|
} else if (field == 'Location') {
|
||||||
|
/* Determine how many locations */
|
||||||
|
var locations = [];
|
||||||
|
|
||||||
|
data.forEach(function(item) {
|
||||||
|
var loc = item.location;
|
||||||
|
|
||||||
|
if (!locations.includes(loc)) {
|
||||||
|
locations.push(loc);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (locations.length > 1) {
|
||||||
|
return "In " + locations.length + " locations";
|
||||||
|
} else {
|
||||||
|
return renderLink(data[0].location_detail.pathstring, data[0].location_detail.url);
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
<!-- CSS -->
|
<!-- CSS -->
|
||||||
<link rel="stylesheet" href="{% static 'css/bootstrap_3.3.7_css_bootstrap.min.css' %}">
|
<link rel="stylesheet" href="{% static 'css/bootstrap_3.3.7_css_bootstrap.min.css' %}">
|
||||||
<link rel="stylesheet" href="{% static 'css/bootstrap-table.css' %}">
|
<link rel="stylesheet" href="{% static 'css/bootstrap-table.css' %}">
|
||||||
|
<link rel="stylesheet" href="{% static 'css/bootstrap-table-group-by.css' %}">
|
||||||
<link rel="stylesheet" href="{% static 'css/select2.css' %}">
|
<link rel="stylesheet" href="{% static 'css/select2.css' %}">
|
||||||
<link rel="stylesheet" href="{% static 'css/select2-bootstrap.css' %}">
|
<link rel="stylesheet" href="{% static 'css/select2-bootstrap.css' %}">
|
||||||
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
|
<link rel="stylesheet" href="{% static 'css/inventree.css' %}">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user