mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 20:45:44 +00:00
Merge pull request #1397 from SchrodingersGat/order-report
Order report
This commit is contained in:
@ -35,7 +35,10 @@ src="{% static 'img/blank_image.png' %}"
|
||||
<hr>
|
||||
<p>{{ order.description }}</p>
|
||||
<div class='btn-row'>
|
||||
<div class='btn-group action-buttons'>
|
||||
<div class='btn-group action-buttons' role='group'>
|
||||
<button type='button' class='btn btn-default' id='print-order-report' title='{% trans "Print" %}'>
|
||||
<span class='fas fa-print'></span>
|
||||
</button>
|
||||
{% if roles.purchase_order.change %}
|
||||
<button type='button' class='btn btn-default' id='edit-order' title='{% trans "Edit order information" %}'>
|
||||
<span class='fas fa-edit icon-green'></span>
|
||||
@ -156,6 +159,10 @@ $("#place-order").click(function() {
|
||||
});
|
||||
{% endif %}
|
||||
|
||||
$('#print-order-report').click(function() {
|
||||
printPurchaseOrderReports([{{ order.pk }}]);
|
||||
});
|
||||
|
||||
$("#edit-order").click(function() {
|
||||
launchModalForm("{% url 'po-edit' order.id %}",
|
||||
{
|
||||
|
@ -15,18 +15,24 @@ InvenTree | {% trans "Purchase Orders" %}
|
||||
|
||||
<div id='table-buttons'>
|
||||
<div class='button-toolbar container-fluid' style='float: right;'>
|
||||
{% if roles.purchase_order.add %}
|
||||
<button class='btn btn-primary' type='button' id='po-create' title='{% trans "Create new purchase order" %}'>
|
||||
<span class='fas fa-plus-circle'></span> {% trans "New Purchase Order" %}</button>
|
||||
{% endif %}
|
||||
<button class='btn btn-default' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'>
|
||||
<span class='fas fa-calendar-alt'></span>
|
||||
</button>
|
||||
<button class='btn btn-default' type='button' id='view-list' title='{% trans "Display list view" %}'>
|
||||
<span class='fas fa-th-list'></span>
|
||||
</button>
|
||||
<div class='filter-list' id='filter-list-purchaseorder'>
|
||||
<!-- An empty div in which the filter list will be constructed -->
|
||||
<div class='btn-group'>
|
||||
{% if roles.purchase_order.add %}
|
||||
<button class='btn btn-primary' type='button' id='po-create' title='{% trans "Create new purchase order" %}'>
|
||||
<span class='fas fa-plus-circle'></span> {% trans "New Purchase Order" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
<button id='order-print' class='btn btn-default' title='{% trans "Print Order Reports" %}'>
|
||||
<span class='fas fa-print'></span>
|
||||
</button>
|
||||
<button class='btn btn-default' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'>
|
||||
<span class='fas fa-calendar-alt'></span>
|
||||
</button>
|
||||
<button class='btn btn-default' type='button' id='view-list' title='{% trans "Display list view" %}'>
|
||||
<span class='fas fa-th-list'></span>
|
||||
</button>
|
||||
<div class='filter-list' id='filter-list-purchaseorder'>
|
||||
<!-- An empty div in which the filter list will be constructed -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -154,6 +160,18 @@ $("#view-list").click(function() {
|
||||
$("#view-calendar").show();
|
||||
});
|
||||
|
||||
$("#order-print").click(function() {
|
||||
var rows = $("#purchase-order-table").bootstrapTable('getSelections');
|
||||
|
||||
var orders = [];
|
||||
|
||||
rows.forEach(function(row) {
|
||||
orders.push(row.pk);
|
||||
});
|
||||
|
||||
printPurchaseOrderReports(orders);
|
||||
})
|
||||
|
||||
$("#po-create").click(function() {
|
||||
launchModalForm("{% url 'po-create' %}",
|
||||
{
|
||||
|
@ -45,6 +45,9 @@ src="{% static 'img/blank_image.png' %}"
|
||||
<p>{{ order.description }}</p>
|
||||
<div class='btn-row'>
|
||||
<div class='btn-group action-buttons'>
|
||||
<button type='button' class='btn btn-default' id='print-order-report' title='{% trans "Print" %}'>
|
||||
<span class='fas fa-print'></span>
|
||||
</button>
|
||||
{% if roles.sales_order.change %}
|
||||
<button type='button' class='btn btn-default' id='edit-order' title='Edit order information'>
|
||||
<span class='fas fa-edit icon-green'></span>
|
||||
@ -165,4 +168,8 @@ $("#ship-order").click(function() {
|
||||
});
|
||||
});
|
||||
|
||||
$('#print-order-report').click(function() {
|
||||
printSalesOrderReports([{{ order.pk }}]);
|
||||
});
|
||||
|
||||
{% endblock %}
|
@ -15,18 +15,24 @@ InvenTree | {% trans "Sales Orders" %}
|
||||
|
||||
<div id='table-buttons'>
|
||||
<div class='button-toolbar container-fluid' style='float: right;'>
|
||||
{% if roles.sales_order.add %}
|
||||
<button class='btn btn-primary' type='button' id='so-create' title='{% trans "Create new sales order" %}'>
|
||||
<span class='fas fa-plus-circle'></span> {% trans "New Sales Order" %}</button>
|
||||
{% endif %}
|
||||
<button class='btn btn-default' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'>
|
||||
<span class='fas fa-calendar-alt'></span>
|
||||
</button>
|
||||
<button class='btn btn-default' type='button' id='view-list' title='{% trans "Display list view" %}'>
|
||||
<span class='fas fa-th-list'></span>
|
||||
</button>
|
||||
<div class='filter-list' id='filter-list-salesorder'>
|
||||
<!-- An empty div in which the filter list will be constructed -->
|
||||
<div class='btn-group'>
|
||||
{% if roles.sales_order.add %}
|
||||
<button class='btn btn-primary' type='button' id='so-create' title='{% trans "Create new sales order" %}'>
|
||||
<span class='fas fa-plus-circle'></span> {% trans "New Sales Order" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
<button id='order-print' class='btn btn-default' title='{% trans "Print Order Reports" %}'>
|
||||
<span class='fas fa-print'></span>
|
||||
</button>
|
||||
<button class='btn btn-default' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'>
|
||||
<span class='fas fa-calendar-alt'></span>
|
||||
</button>
|
||||
<button class='btn btn-default' type='button' id='view-list' title='{% trans "Display list view" %}'>
|
||||
<span class='fas fa-th-list'></span>
|
||||
</button>
|
||||
<div class='filter-list' id='filter-list-salesorder'>
|
||||
<!-- An empty div in which the filter list will be constructed -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -156,10 +162,30 @@ loadSalesOrderTable("#sales-order-table", {
|
||||
url: "{% url 'api-so-list' %}",
|
||||
});
|
||||
|
||||
$("#order-print").click(function() {
|
||||
var rows = $("#sales-order-table").bootstrapTable('getSelections');
|
||||
|
||||
var orders = [];
|
||||
|
||||
rows.forEach(function(row) {
|
||||
orders.push(row.pk);
|
||||
});
|
||||
|
||||
printSalesOrderReports(orders);
|
||||
})
|
||||
|
||||
$("#so-create").click(function() {
|
||||
launchModalForm("{% url 'so-create' %}",
|
||||
{
|
||||
follow: true,
|
||||
secondary: [
|
||||
{
|
||||
field: 'customer',
|
||||
label: '{% trans "New Customer" %}',
|
||||
title: '{% trans "Create new Customer" %}',
|
||||
url: '{% url "customer-create" %}',
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
});
|
||||
|
Reference in New Issue
Block a user