2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-14 14:41:33 +00:00

Merging master and resolved conflict

This commit is contained in:
eeintech
2020-12-18 17:08:37 -05:00
37 changed files with 1890 additions and 1283 deletions

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 Builds" %}<span class='badge' id='build-overdue-count'><span class='fas fa-spin fa-spinner'></span></span>
{% endblock %}
{% block collapse_content %}
<table class='table table-striped table-condensed' id='build-overdue-table'>
</table>
{% endblock %}

View File

@@ -16,6 +16,7 @@ InvenTree | {% trans "Index" %}
{% endif %}
{% if roles.build.view %}
{% include "InvenTree/build_pending.html" with collapse_id="build_pending" %}
{% include "InvenTree/build_overdue.html" with collapse_id="build_overdue" %}
{% endif %}
</div>
<div class='col-sm-6'>
@@ -28,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>
@@ -72,6 +74,15 @@ loadBuildTable("#build-pending-table", {
disableFilters: true,
});
loadBuildTable("#build-overdue-table", {
url: "{% url 'api-build-list' %}",
params: {
part_detail: true,
overdue: true,
},
disableFilters: true,
});
loadSimplePartTable("#low-stock-table", "{% url 'api-part-list' %}", {
params: {
low_stock: true,
@@ -102,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;
@@ -126,6 +145,12 @@ $("#build-pending-table").on('load-success.bs.table', function() {
$("#build-pending-count").html(count);
});
$("#build-overdue-table").on('load-success.bs.table', function() {
var count = $("#build-overdue-table").bootstrapTable('getData').length;
$("#build-overdue-count").html(count);
});
$("#low-stock-table").on('load-success.bs.table', function() {
var count = $("#low-stock-table").bootstrapTable('getData').length;
@@ -150,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

@@ -45,7 +45,7 @@
{% if category %}
$("#param-table").inventreeTable({
url: "{% url 'api-part-category-parameters' category.pk %}",
url: "{% url 'api-part-category-parameters' pk=category.pk %}",
queryParams: {
ordering: 'name',
},
@@ -58,7 +58,7 @@
switchable: false,
},
{
field: 'parameter_template_detail.name',
field: 'parameter_template.name',
title: '{% trans "Parameter Template" %}',
sortable: 'true',
},

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 %}

View File

@@ -650,7 +650,13 @@ function loadBuildTable(table, options) {
value = `${prefix}${value}`;
}
return renderLink(value, '/build/' + row.pk + '/');
var html = renderLink(value, '/build/' + row.pk + '/');
if (row.overdue) {
html += makeIconBadge('fa-calendar-times icon-red', '{% trans "Build order is overdue" %}');
}
return html;
}
},
{
@@ -699,6 +705,11 @@ function loadBuildTable(table, options) {
title: '{% trans "Created" %}',
sortable: true,
},
{
field: 'target_date',
title: '{% trans "Target Date" %}',
sortable: true,
},
{
field: 'completion_date',
title: '{% trans "Completed" %}',

View File

@@ -235,7 +235,13 @@ function loadSalesOrderTable(table, options) {
value = `${prefix}${value}`;
}
return renderLink(value, `/order/sales-order/${row.pk}/`);
var html = renderLink(value, `/order/sales-order/${row.pk}/`);
if (row.overdue) {
html += makeIconBadge('fa-calendar-times icon-red', '{% trans "Order is overdue" %}');
}
return html;
},
},
{
@@ -269,6 +275,11 @@ function loadSalesOrderTable(table, options) {
field: 'creation_date',
title: '{% trans "Creation Date" %}',
},
{
sortable: true,
field: 'target_date',
title: '{% trans "Target Date" %}',
},
{
sortable: true,
field: 'shipment_date',

View File

@@ -202,7 +202,7 @@ function loadPartVariantTable(table, partId, options={}) {
showColumns: true,
original: params,
queryParams: filters,
formatNoMatches: function() { return "{% trans "No variants found" %}"; },
formatNoMatches: function() { return '{% trans "No variants found" %}'; },
columns: cols,
treeEnable: true,
rootParentId: partId,
@@ -249,7 +249,7 @@ function loadParametricPartTable(table, options={}) {
if (header === 'part') {
columns.push({
field: header,
title: '{% trans 'Part' %}',
title: '{% trans "Part" %}',
sortable: true,
sortName: 'name',
formatter: function(value, row, index, field) {
@@ -268,7 +268,7 @@ function loadParametricPartTable(table, options={}) {
} else if (header === 'description') {
columns.push({
field: header,
title: '{% trans 'Description' %}',
title: '{% trans "Description" %}',
sortable: true,
});
} else {
@@ -288,7 +288,7 @@ function loadParametricPartTable(table, options={}) {
queryParams: table_headers,
groupBy: false,
name: options.name || 'parametric',
formatNoMatches: function() { return "{% trans "No parts found" %}"; },
formatNoMatches: function() { return '{% trans "No parts found" %}'; },
columns: columns,
showColumns: true,
data: table_data,
@@ -454,7 +454,7 @@ function loadPartTable(table, url, options={}) {
groupBy: false,
name: options.name || 'part',
original: params,
formatNoMatches: function() { return "{% trans "No parts found" %}"; },
formatNoMatches: function() { return '{% trans "No parts found" %}'; },
columns: columns,
showColumns: true,
});
@@ -564,12 +564,12 @@ function loadPartTestTemplateTable(table, options) {
},
{
field: 'test_name',
title: "{% trans "Test Name" %}",
title: '{% trans "Test Name" %}',
sortable: true,
},
{
field: 'description',
title: "{% trans "Description" %}",
title: '{% trans "Description" %}',
},
{
field: 'required',
@@ -581,14 +581,14 @@ function loadPartTestTemplateTable(table, options) {
},
{
field: 'requires_value',
title: "{% trans "Requires Value" %}",
title: '{% trans "Requires Value" %}',
formatter: function(value) {
return yesNoLabel(value);
}
},
{
field: 'requires_attachment',
title: "{% trans "Requires Attachment" %}",
title: '{% trans "Requires Attachment" %}',
formatter: function(value) {
return yesNoLabel(value);
}
@@ -608,7 +608,9 @@ function loadPartTestTemplateTable(table, options) {
return html;
} else {
return '{% trans "This test is defined for a parent part" %}';
var text = '{% trans "This test is defined for a parent part" %}';
return renderLink(text, `/part/${row.part}/tests/`);
}
}
}

View File

@@ -184,7 +184,11 @@ function getAvailableTableFilters(tableKey) {
active: {
type: 'bool',
title: '{% trans "Active" %}',
}
},
overdue: {
type: 'bool',
title: '{% trans "Overdue" %}',
},
};
}
@@ -213,6 +217,10 @@ function getAvailableTableFilters(tableKey) {
type: 'bool',
title: '{% trans "Outstanding" %}',
},
overdue: {
type: 'bool',
title: '{% trans "Overdue" %}',
},
};
}

View File

@@ -1,4 +1,5 @@
{% load static %}
{% load i18n %}
<!DOCTYPE html>
<html lang="en">
@@ -26,22 +27,25 @@
<div class='login'>
<div class="row">
<div class="col-md-2 col-md-offset-5">
<div class='container-fluid'>
<div class='clearfix content-heading'>
<img class="pull-left" src="{% static 'img/inventree.png' %}" width="60" height="60"/> <h3>InvenTree</h3>
</div>
<hr>
<img class="pull-left" src="{% static 'img/inventree.png' %}" width="60" height="60"/> <h3>InvenTree</h3>
</div>
<hr>
<div class='container-fluid'>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button class='pull-right btn btn-primary' type="submit">Login</button>
</form>
<div class='container-fluid'>
<form method="post" action=''>
{% csrf_token %}
{% load crispy_forms_tags %}
{{ form|crispy }}
<button class='pull-right btn btn-primary' type="submit">{% trans "Login" %}</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>