mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Display more units (#3664)
* < * Display units in "used in" table * Display units in BOM table * Include units in the 'available' column of BOM table
This commit is contained in:
parent
875dda7e59
commit
c4db308dce
@ -205,7 +205,7 @@
|
||||
<tr>
|
||||
<td><span class='fas fa-shopping-cart'></span></td>
|
||||
<td>{% trans "On Order" %}</td>
|
||||
<td>{% decimal on_order %} {% include "part/part_units.html" %}/td>
|
||||
<td>{% decimal on_order %} {% include "part/part_units.html" %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.component %}
|
||||
|
@ -868,6 +868,10 @@ function loadBomTable(table, options={}) {
|
||||
// Let's make it a bit more pretty
|
||||
text = parseFloat(text);
|
||||
|
||||
if (row.sub_part_detail && row.sub_part_detail.units) {
|
||||
text += ` <small>${row.sub_part_detail.units}</small>`;
|
||||
}
|
||||
|
||||
if (row.optional) {
|
||||
text += ' ({% trans "Optional" %})';
|
||||
}
|
||||
@ -923,6 +927,10 @@ function loadBomTable(table, options={}) {
|
||||
|
||||
var text = `${available_stock}`;
|
||||
|
||||
if (row.sub_part_detail && row.sub_part_detail.units) {
|
||||
text += ` <small>${row.sub_part_detail.units}</small>`;
|
||||
}
|
||||
|
||||
if (available_stock <= 0) {
|
||||
text += `<span class='fas fa-times-circle icon-red float-right' title='{% trans "No Stock Available" %}'></span>`;
|
||||
} else {
|
||||
@ -1482,6 +1490,10 @@ function loadUsedInTable(table, part_id, options={}) {
|
||||
formatter: function(value, row) {
|
||||
var html = value;
|
||||
|
||||
if (row.sub_part_detail && row.sub_part_detail.units) {
|
||||
html += ` <small>${row.sub_part_detail.units}</small>`;
|
||||
}
|
||||
|
||||
if (row.parent && row.parent != 'top-level-item') {
|
||||
html += ` <em>({% trans "Inherited from parent BOM" %})</em>`;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user