mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Display expiry status on StockItem page
- Also adds ability to filter Stock table by expired status
This commit is contained in:
parent
39b9dcfec9
commit
a0c95579b4
@ -71,6 +71,9 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
|||||||
<h3>
|
<h3>
|
||||||
{% trans "Stock Item" %}
|
{% trans "Stock Item" %}
|
||||||
{% stock_status_label item.status large=True %}
|
{% stock_status_label item.status large=True %}
|
||||||
|
{% if item.is_expired %}
|
||||||
|
<span class='label label-large label-large-red'>{% trans "Expired" %}</span>
|
||||||
|
{% endif %}
|
||||||
</h3>
|
</h3>
|
||||||
<hr>
|
<hr>
|
||||||
<h4>
|
<h4>
|
||||||
@ -293,6 +296,18 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
|||||||
<td><a href="{% url 'supplier-part-detail' item.supplier_part.id %}">{{ item.supplier_part.SKU }}</a></td>
|
<td><a href="{% url 'supplier-part-detail' item.supplier_part.id %}">{{ item.supplier_part.SKU }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if item.expiry_date %}
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-calendar-alt{% if item.is_expired %} icon-red{% endif %}'></span></td>
|
||||||
|
<td>{% trans "Expiry Date" %}</td>
|
||||||
|
<td>
|
||||||
|
{{ item.expiry_date }}
|
||||||
|
{% if item.is_expired %}
|
||||||
|
<span title='[% trans "This StockItem expired on" %} {{ item.expiry_date }}' class='label label-red'>{% trans "Expired" %}</span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Last Updated" %}</td>
|
<td>{% trans "Last Updated" %}</td>
|
||||||
|
@ -532,6 +532,10 @@ function loadStockTable(table, options) {
|
|||||||
html += makeIconBadge('fa-user', '{% trans "Stock item assigned to customer" %}');
|
html += makeIconBadge('fa-user', '{% trans "Stock item assigned to customer" %}');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (row.expired) {
|
||||||
|
html += makeIconBadge('fa-stopwatch icon-red', '{% trans "Stock item has expired" %}');
|
||||||
|
}
|
||||||
|
|
||||||
if (row.allocated) {
|
if (row.allocated) {
|
||||||
html += makeIconBadge('fa-bookmark', '{% trans "Stock item has been allocated" %}');
|
html += makeIconBadge('fa-bookmark', '{% trans "Stock item has been allocated" %}');
|
||||||
}
|
}
|
||||||
|
@ -106,6 +106,11 @@ function getAvailableTableFilters(tableKey) {
|
|||||||
title: '{% trans "Depleted" %}',
|
title: '{% trans "Depleted" %}',
|
||||||
description: '{% trans "Show stock items which are depleted" %}',
|
description: '{% trans "Show stock items which are depleted" %}',
|
||||||
},
|
},
|
||||||
|
expired: {
|
||||||
|
type: 'bool',
|
||||||
|
title: '{% trans "Expired" %}',
|
||||||
|
description: '{% trans "Show stock items which have expired" %}',
|
||||||
|
},
|
||||||
in_stock: {
|
in_stock: {
|
||||||
type: 'bool',
|
type: 'bool',
|
||||||
title: '{% trans "In Stock" %}',
|
title: '{% trans "In Stock" %}',
|
||||||
|
Loading…
Reference in New Issue
Block a user