mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
part variant table now displays information about variant stock quantities
This commit is contained in:
parent
8b9aa86a0a
commit
f504dfe797
@ -672,7 +672,20 @@ function loadPartVariantTable(table, partId, options={}) {
|
|||||||
field: 'in_stock',
|
field: 'in_stock',
|
||||||
title: '{% trans "Stock" %}',
|
title: '{% trans "Stock" %}',
|
||||||
formatter: function(value, row) {
|
formatter: function(value, row) {
|
||||||
return renderLink(value, `/part/${row.pk}/?display=part-stock`);
|
|
||||||
|
var base_stock = row.in_stock;
|
||||||
|
var variant_stock = row.variant_stock || 0;
|
||||||
|
|
||||||
|
var total = base_stock + variant_stock;
|
||||||
|
|
||||||
|
var text = `${total}`;
|
||||||
|
|
||||||
|
if (variant_stock > 0) {
|
||||||
|
text = `<em>${text}</em>`;
|
||||||
|
text += `<span title='{% trans "Includes variant stock" %}' class='fas fa-info-circle float-right icon-blue'></span>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return renderLink(text, `/part/${row.pk}/?display=part-stock`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user