Add "overdue sales orders" to index page

This commit is contained in:
Oliver Walters 2020-12-18 12:45:42 +11:00
parent c34196538b
commit 8e13a7b470
2 changed files with 30 additions and 0 deletions

View File

@ -29,6 +29,7 @@ InvenTree | {% trans "Index" %}
{% endif %}
{% if roles.sales_order.view %}
{% include "InvenTree/so_outstanding.html" with collapse_id="so_outstanding" %}
{% include "InvenTree/so_overdue.html" with collapse_id="so_overdue" %}
{% endif %}
</div>
@ -112,6 +113,14 @@ loadSalesOrderTable("#so-outstanding-table", {
},
});
loadSalesOrderTable("#so-overdue-table", {
url: "{% url 'api-so-list' %}",
params: {
overdue: true,
customer_detail: true,
}
});
$("#latest-parts-table").on('load-success.bs.table', function() {
var count = $("#latest-parts-table").bootstrapTable('getData').length;
@ -166,4 +175,10 @@ $("#so-outstanding-table").on('load-success.bs.table', function() {
$("#so-outstanding-count").html(count);
});
$("#so-overdue-table").on('load-success.bs.table', function() {
var count = $("#so-overdue-table").bootstrapTable('getData').length;
$("#so-overdue-count").html(count);
});
{% endblock %}

View File

@ -0,0 +1,15 @@
{% extends "collapse_index.html" %}
{% load i18n %}
{% block collapse_title %}
<span class='fas fa-calendar-times icon-header'></span>
{% trans "Overdue Sales Orders" %}<span class='badge' id='so-overdue-count'><span class='fas fa-spin fa-spinner'></span></span>
{% endblock %}
{% block collapse_content %}
<table class='table table-striped table-condensed' id='so-overdue-table'>
</table>
{% endblock %}