2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00

Display "on order" quantity in build order allocation table (#3585)

This commit is contained in:
Oliver 2022-08-22 12:24:13 +10:00 committed by GitHub
parent b886e54709
commit bee5b6d124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1841,14 +1841,20 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
text += `${available_stock}`; text += `${available_stock}`;
} }
var icons = '';
if (available_stock < (required - allocated)) { if (available_stock < (required - allocated)) {
text += `<span class='fas fa-times-circle icon-red float-right' title='{% trans "Insufficient stock available" %}'></span>`; icons += `<span class='fas fa-times-circle icon-red float-right' title='{% trans "Insufficient stock available" %}'></span>`;
} else { } else {
text += `<span class='fas fa-check-circle icon-green float-right' title='{% trans "Sufficient stock available" %}'></span>`; icons += `<span class='fas fa-check-circle icon-green float-right' title='{% trans "Sufficient stock available" %}'></span>`;
}
if (row.on_order && row.on_order > 0) {
icons += `<span class='fas fa-shopping-cart float-right' title='{% trans "On Order" %}: ${row.on_order}'></span>`;
} }
if (available_stock <= 0) { if (available_stock <= 0) {
text += `<span class='badge rounded-pill bg-danger'>{% trans "No Stock Available" %}</span>`; icons += `<span class='badge rounded-pill bg-danger'>{% trans "No Stock Available" %}</span>`;
} else { } else {
var extra = ''; var extra = '';
if ((substitute_stock > 0) && (variant_stock > 0)) { if ((substitute_stock > 0) && (variant_stock > 0)) {
@ -1860,11 +1866,11 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
} }
if (extra) { if (extra) {
text += `<span title='${extra}' class='fas fa-info-circle float-right icon-blue'></span>`; icons += `<span title='${extra}' class='fas fa-info-circle float-right icon-blue'></span>`;
} }
} }
return renderLink(text, url); return renderLink(text, url) + icons;
}, },
sorter: function(valA, valB, rowA, rowB) { sorter: function(valA, valB, rowA, rowB) {