From 8e13a7b470a289e315e6be96a6df6c59573f9c7b Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 18 Dec 2020 12:45:42 +1100 Subject: [PATCH] Add "overdue sales orders" to index page --- InvenTree/templates/InvenTree/index.html | 15 +++++++++++++++ InvenTree/templates/InvenTree/so_overdue.html | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 InvenTree/templates/InvenTree/so_overdue.html diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html index 2f6898788c..f862175920 100644 --- a/InvenTree/templates/InvenTree/index.html +++ b/InvenTree/templates/InvenTree/index.html @@ -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 %} @@ -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 %} \ No newline at end of file diff --git a/InvenTree/templates/InvenTree/so_overdue.html b/InvenTree/templates/InvenTree/so_overdue.html new file mode 100644 index 0000000000..bf2b64a1e3 --- /dev/null +++ b/InvenTree/templates/InvenTree/so_overdue.html @@ -0,0 +1,15 @@ +{% extends "collapse_index.html" %} + +{% load i18n %} + +{% block collapse_title %} + +{% trans "Overdue Sales Orders" %} +{% endblock %} + +{% block collapse_content %} + + +
+ +{% endblock %} \ No newline at end of file