From 945c3c214dcf10bb0d5143643dfaea074476ea21 Mon Sep 17 00:00:00 2001 From: eeintech Date: Thu, 17 Sep 2020 17:19:19 -0500 Subject: [PATCH] Added outstanding purchase and sales orders views to homepage --- .../templates/InvenTree/build_pending.html | 2 +- InvenTree/templates/InvenTree/index.html | 55 ++++++++++++++++--- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/InvenTree/templates/InvenTree/build_pending.html b/InvenTree/templates/InvenTree/build_pending.html index 8d8ba7befa..31a083cfc0 100644 --- a/InvenTree/templates/InvenTree/build_pending.html +++ b/InvenTree/templates/InvenTree/build_pending.html @@ -3,7 +3,7 @@ {% load i18n %} {% block collapse_title %} - + {% trans "Pending Builds" %}0 {% endblock %} diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html index b754414efc..c5903d112b 100644 --- a/InvenTree/templates/InvenTree/index.html +++ b/InvenTree/templates/InvenTree/index.html @@ -12,25 +12,35 @@ InvenTree | Index
{% include "InvenTree/latest_parts.html" with collapse_id="latest_parts" %}
-
- {% include "InvenTree/bom_invalid.html" with collapse_id="bom_invalid" %} -
- - -
{% include "InvenTree/starred_parts.html" with collapse_id="starred" %}
-
- {% include "InvenTree/low_stock.html" with collapse_id="order" %} -
+
+
+ {% include "InvenTree/bom_invalid.html" with collapse_id="bom_invalid" %} +
{% include "InvenTree/build_pending.html" with collapse_id="build_pending" %}
+
+ +
+ {% include "InvenTree/low_stock.html" with collapse_id="order" %} +
+
+
+
+ +
+
+ {% include "InvenTree/po_outstanding.html" with collapse_id="po_outstanding" %} +
+
+ {% include "InvenTree/so_outstanding.html" with collapse_id="so_outstanding" %}
@@ -76,6 +86,22 @@ loadBuildTable("#build-pending-table", { } }); +loadPurchaseOrderTable("#po-outstanding-table", { + url: "{% url 'api-po-list' %}", + params: { + "supplier_detail": true, + "oustanding": true, + } +}); + +loadSalesOrderTable("#so-outstanding-table", { + url: "{% url 'api-so-list' %}", + params: { + "customer_detail": true, + "oustanding": true, + } +}); + $("#bom-invalid-table").on('load-success.bs.table', function() { var count = $("#bom-invalid-table").bootstrapTable('getData').length; @@ -107,5 +133,16 @@ $("#build-pending-table").on('load-success.bs.table', function() { $("#build-pending-count").html(count); }); +$("#po-outstanding-table").on('load-success.bs.table', function() { + var count = $("#po-outstanding-table").bootstrapTable('getData').length; + + $("#po-outstanding-count").html(count); +}); + +$("#so-outstanding-table").on('load-success.bs.table', function() { + var count = $("#so-outstanding-table").bootstrapTable('getData').length; + + $("#so-outstanding-count").html(count); +}); {% endblock %} \ No newline at end of file