diff --git a/InvenTree/templates/InvenTree/expired_stock.html b/InvenTree/templates/InvenTree/expired_stock.html new file mode 100644 index 0000000000..7ecf117fa7 --- /dev/null +++ b/InvenTree/templates/InvenTree/expired_stock.html @@ -0,0 +1,15 @@ +{% extends "collapse_index.html" %} + +{% load i18n %} + +{% block collapse_title %} + +{% trans "Expired Stock" %} +{% endblock %} + +{% block collapse_content %} + + +
+ +{% endblock %} \ No newline at end of file diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html index f862175920..d5b2c87148 100644 --- a/InvenTree/templates/InvenTree/index.html +++ b/InvenTree/templates/InvenTree/index.html @@ -8,7 +8,7 @@ InvenTree | {% trans "Index" %}

InvenTree


-
+
{% if roles.part.view %} {% include "InvenTree/latest_parts.html" with collapse_id="latest_parts" %} {% include "InvenTree/bom_invalid.html" with collapse_id="bom_invalid" %} @@ -19,11 +19,14 @@ InvenTree | {% trans "Index" %} {% include "InvenTree/build_overdue.html" with collapse_id="build_overdue" %} {% endif %}
-
+
{% if roles.stock.view %} {% include "InvenTree/low_stock.html" with collapse_id="order" %} + {% include "InvenTree/expired_stock.html" with collapse_id="expired" %} {% include "InvenTree/required_stock_build.html" with collapse_id="stock_to_build" %} {% endif %} +
+
{% if roles.purchase_order.view %} {% include "InvenTree/po_outstanding.html" with collapse_id="po_outstanding" %} {% endif %} @@ -83,6 +86,14 @@ loadBuildTable("#build-overdue-table", { disableFilters: true, }); +loadStockTable($("#expired-stock-table"), { + params: { + expired: true, + location_detail: true, + part_detail: true, + }, +}); + loadSimplePartTable("#low-stock-table", "{% url 'api-part-list' %}", { params: { low_stock: true, @@ -151,6 +162,12 @@ $("#build-overdue-table").on('load-success.bs.table', function() { $("#build-overdue-count").html(count); }); +$("#expired-stock-table").on('load-success.bs.table', function() { + var count = $("#expired-stock-table").bootstrapTable('getData').length; + + $("#expired-stock-count").html(count); +}); + $("#low-stock-table").on('load-success.bs.table', function() { var count = $("#low-stock-table").bootstrapTable('getData').length; diff --git a/InvenTree/templates/collapse_index.html b/InvenTree/templates/collapse_index.html index d87f63b244..6e918d7217 100644 --- a/InvenTree/templates/collapse_index.html +++ b/InvenTree/templates/collapse_index.html @@ -1,6 +1,6 @@ {% block collapse_preamble %} {% endblock %} -
+