2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Add setting for enabeling reports

Fixes #2278
This commit is contained in:
Matthias
2021-11-10 23:54:54 +01:00
parent 4d6189653e
commit bae28e8207
11 changed files with 39 additions and 2 deletions

View File

@ -29,7 +29,9 @@
<span class='fas fa-print'></span> <span class='caret'></span>
</button>
<ul class='dropdown-menu' role='menu'>
{% if report_enabled %}
<li><a class='dropdown-item' href='#' id='print-order-report'><span class='fas fa-file-pdf'></span> {% trans "Print purchase order report" %}</a></li>
{% endif %}
<li><a class='dropdown-item' href='#' id='export-order'><span class='fas fa-file-download'></span> {% trans "Export order to file" %}</a></li>
</ul>
</div>
@ -169,9 +171,11 @@ $("#place-order").click(function() {
});
{% endif %}
{% if report_enabled %}
$('#print-order-report').click(function() {
printPurchaseOrderReports([{{ order.pk }}]);
});
{% endif %}
$("#edit-order").click(function() {

View File

@ -26,10 +26,11 @@
<div id='table-buttons'>
<div class='button-toolbar container-fluid' style='float: right;'>
<div class='btn-group' role='group'>
{% if report_enabled %}
<button id='order-print' class='btn btn-outline-secondary' title='{% trans "Print Order Reports" %}'>
<span class='fas fa-print'></span>
</button>
{% endif %}
<button class='btn btn-outline-secondary' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'>
<span class='fas fa-calendar-alt'></span>
</button>
@ -169,6 +170,7 @@ $("#view-list").click(function() {
$("#view-calendar").show();
});
{% if report_enabled %}
$("#order-print").click(function() {
var rows = $("#purchase-order-table").bootstrapTable('getSelections');
@ -180,6 +182,7 @@ $("#order-print").click(function() {
printPurchaseOrderReports(orders);
})
{% endif %}
$("#po-create").click(function() {
createPurchaseOrder();

View File

@ -39,7 +39,9 @@ src="{% static 'img/blank_image.png' %}"
<span class='fas fa-print'></span> <span class='caret'></span>
</button>
<ul class='dropdown-menu' role='menu'>
{% if report_enabled %}
<li><a class='dropdown-item' href='#' id='print-order-report'><span class='fas fa-file-pdf'></span> {% trans "Print sales order report" %}</a></li>
{% endif %}
<li><a class='dropdown-item' href='#' id='export-order'><span class='fas fa-file-download'></span> {% trans "Export order to file" %}</a></li>
<!--
<li><a class='dropdown-item' href='#' id='print-packing-list'><span class='fas fa-clipboard-list'></span>{% trans "Print packing list" %}</a></li>
@ -206,9 +208,11 @@ $("#ship-order").click(function() {
});
});
{% if report_enabled %}
$('#print-order-report').click(function() {
printSalesOrderReports([{{ order.pk }}]);
});
{% endif %}
$('#export-order').click(function() {
exportOrder('{% url "so-export" order.id %}');

View File

@ -29,10 +29,11 @@
<div id='table-buttons'>
<div class='button-toolbar container-fluid' style='float: right;'>
<div class='btn-group'>
{% if report_enabled %}
<button id='order-print' class='btn btn-outline-secondary' title='{% trans "Print Order Reports" %}'>
<span class='fas fa-print'></span>
</button>
{% endif %}
<button class='btn btn-outline-secondary' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'>
<span class='fas fa-calendar-alt'></span>
</button>
@ -173,6 +174,7 @@ loadSalesOrderTable("#sales-order-table", {
url: "{% url 'api-so-list' %}",
});
{% if report_enabled %}
$("#order-print").click(function() {
var rows = $("#sales-order-table").bootstrapTable('getSelections');
@ -184,6 +186,7 @@ $("#order-print").click(function() {
printSalesOrderReports(orders);
})
{% endif %}
$("#so-create").click(function() {
createSalesOrder();