mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +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>
|
<tr>
|
||||||
<td><span class='fas fa-shopping-cart'></span></td>
|
<td><span class='fas fa-shopping-cart'></span></td>
|
||||||
<td>{% trans "On Order" %}</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>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if part.component %}
|
{% if part.component %}
|
||||||
|
@ -868,6 +868,10 @@ function loadBomTable(table, options={}) {
|
|||||||
// Let's make it a bit more pretty
|
// Let's make it a bit more pretty
|
||||||
text = parseFloat(text);
|
text = parseFloat(text);
|
||||||
|
|
||||||
|
if (row.sub_part_detail && row.sub_part_detail.units) {
|
||||||
|
text += ` <small>${row.sub_part_detail.units}</small>`;
|
||||||
|
}
|
||||||
|
|
||||||
if (row.optional) {
|
if (row.optional) {
|
||||||
text += ' ({% trans "Optional" %})';
|
text += ' ({% trans "Optional" %})';
|
||||||
}
|
}
|
||||||
@ -923,6 +927,10 @@ function loadBomTable(table, options={}) {
|
|||||||
|
|
||||||
var text = `${available_stock}`;
|
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) {
|
if (available_stock <= 0) {
|
||||||
text += `<span class='fas fa-times-circle icon-red float-right' title='{% trans "No Stock Available" %}'></span>`;
|
text += `<span class='fas fa-times-circle icon-red float-right' title='{% trans "No Stock Available" %}'></span>`;
|
||||||
} else {
|
} else {
|
||||||
@ -1482,6 +1490,10 @@ function loadUsedInTable(table, part_id, options={}) {
|
|||||||
formatter: function(value, row) {
|
formatter: function(value, row) {
|
||||||
var html = value;
|
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') {
|
if (row.parent && row.parent != 'top-level-item') {
|
||||||
html += ` <em>({% trans "Inherited from parent BOM" %})</em>`;
|
html += ` <em>({% trans "Inherited from parent BOM" %})</em>`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user