mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 21:15:41 +00:00
Merge remote-tracking branch 'upstream/master' into django-q
This commit is contained in:
@ -59,7 +59,7 @@ function newPurchaseOrderFromOrderWizard(e) {
|
||||
|
||||
var src = e.target || e.srcElement;
|
||||
|
||||
var supplier = $(src).attr('supplier-id');
|
||||
var supplier = $(src).attr('supplierid');
|
||||
|
||||
launchModalForm("/order/purchase-order/new/", {
|
||||
modal: '#modal-form-secondary',
|
||||
@ -138,9 +138,9 @@ function loadPurchaseOrderTable(table, options) {
|
||||
formatNoMatches: function() { return '{% trans "No purchase orders found" %}'; },
|
||||
columns: [
|
||||
{
|
||||
field: 'pk',
|
||||
title: 'ID',
|
||||
visible: false,
|
||||
title: '',
|
||||
visible: true,
|
||||
checkbox: true,
|
||||
switchable: false,
|
||||
},
|
||||
{
|
||||
@ -234,9 +234,9 @@ function loadSalesOrderTable(table, options) {
|
||||
formatNoMatches: function() { return '{% trans "No sales orders found" %}'; },
|
||||
columns: [
|
||||
{
|
||||
field: 'pk',
|
||||
title: 'ID',
|
||||
visible: false,
|
||||
title: '',
|
||||
checkbox: true,
|
||||
visible: true,
|
||||
switchable: false,
|
||||
},
|
||||
{
|
||||
|
@ -247,3 +247,111 @@ function printBomReports(parts, options={}) {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
function printPurchaseOrderReports(orders, options={}) {
|
||||
/**
|
||||
* Print PO reports for the provided purchase order(s)
|
||||
*/
|
||||
|
||||
if (orders.length == 0) {
|
||||
showAlertDialog(
|
||||
'{% trans "Select Purchase Orders" %}',
|
||||
'{% trans "Purchase Order(s) must be selected before printing report" %}',
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Request avaiable report templates
|
||||
inventreeGet(
|
||||
'{% url "api-po-report-list" %}',
|
||||
{
|
||||
enabled: true,
|
||||
orders: orders,
|
||||
},
|
||||
{
|
||||
success: function(response) {
|
||||
if (response.length == 0) {
|
||||
showAlertDialog(
|
||||
'{% trans "No Reports Found" %}',
|
||||
'{% trans "No report templates found which match selected orders" %}',
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Select report template
|
||||
selectReport(
|
||||
response,
|
||||
orders,
|
||||
{
|
||||
success: function(pk) {
|
||||
var href = `/api/report/po/${pk}/print/?`;
|
||||
|
||||
orders.forEach(function(order) {
|
||||
href += `order=${order}&`;
|
||||
});
|
||||
|
||||
window.location.href = href;
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
function printSalesOrderReports(orders, options={}) {
|
||||
/**
|
||||
* Print SO reports for the provided purchase order(s)
|
||||
*/
|
||||
|
||||
if (orders.length == 0) {
|
||||
showAlertDialog(
|
||||
'{% trans "Select Sales Orders" %}',
|
||||
'{% trans "Sales Order(s) must be selected before printing report" %}',
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Request avaiable report templates
|
||||
inventreeGet(
|
||||
'{% url "api-so-report-list" %}',
|
||||
{
|
||||
enabled: true,
|
||||
orders: orders,
|
||||
},
|
||||
{
|
||||
success: function(response) {
|
||||
if (response.length == 0) {
|
||||
showAlertDialog(
|
||||
'{% trans "No Reports Found" %}',
|
||||
'{% trans "No report templates found which match selected orders" %}',
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Select report template
|
||||
selectReport(
|
||||
response,
|
||||
orders,
|
||||
{
|
||||
success: function(pk) {
|
||||
var href = `/api/report/so/${pk}/print/?`;
|
||||
|
||||
orders.forEach(function(order) {
|
||||
href += `order=${order}&`;
|
||||
});
|
||||
|
||||
window.location.href = href;
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block content %}
|
||||
<h4>Logout</h4>
|
||||
<p>You have been logged out</p>
|
||||
<p>Click <a href="{% url 'login' %}">here</a> to log in</p>
|
||||
<h4>{% trans "Logout" %}</h4>
|
||||
<p>{% trans "You have been logged out" %}</p>
|
||||
<p>{% trans 'Click' %} <a href="{% url 'login' %}"> {% trans 'here</a> to log in</p>' %}
|
||||
{% endblock %}
|
Reference in New Issue
Block a user