Added outstanding purchase and sales orders views to homepage

This commit is contained in:
eeintech 2020-09-17 17:19:19 -05:00
parent 3d597cc3c3
commit 945c3c214d
2 changed files with 47 additions and 10 deletions

View File

@ -3,7 +3,7 @@
{% load i18n %}
{% block collapse_title %}
<span class='fas fa-times-circle icon-header'></span>
<span class='fas fa-cogs icon-header'></span>
{% trans "Pending Builds" %}<span class='badge' id='build-pending-count'>0</span>
{% endblock %}

View File

@ -12,25 +12,35 @@ InvenTree | Index
<div class="col-sm-6">
{% include "InvenTree/latest_parts.html" with collapse_id="latest_parts" %}
</div>
<div class="col-sm-6">
{% include "InvenTree/bom_invalid.html" with collapse_id="bom_invalid" %}
</div>
</div>
<div class="row">
<div class="col-sm-6">
{% include "InvenTree/starred_parts.html" with collapse_id="starred" %}
</div>
<div class="col-sm-6">
{% include "InvenTree/low_stock.html" with collapse_id="order" %}
</div>
</div>
<div class="row">
<div class="col-sm-6">
{% include "InvenTree/bom_invalid.html" with collapse_id="bom_invalid" %}
</div>
<div class="col-sm-6">
{% include "InvenTree/build_pending.html" with collapse_id="build_pending" %}
</div>
</div>
<div class="row">
<div class="col-sm-6">
{% include "InvenTree/low_stock.html" with collapse_id="order" %}
</div>
<div class="col-sm-6">
</div>
</div>
<div class="row">
<div class="col-sm-6">
{% include "InvenTree/po_outstanding.html" with collapse_id="po_outstanding" %}
</div>
<div class="col-sm-6">
{% include "InvenTree/so_outstanding.html" with collapse_id="so_outstanding" %}
</div>
</div>
@ -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 %}