mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-19 13:20:37 -06:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4868194a0b | ||
|
|
53e442f555 | ||
|
|
9f6d860554 | ||
|
|
a1908f1bf1 | ||
|
|
c29e58aeaa | ||
|
|
fdaf6d3e19 | ||
|
|
78badcd65b |
@@ -13,7 +13,7 @@ import common.models
|
|||||||
from InvenTree.api_version import INVENTREE_API_VERSION
|
from InvenTree.api_version import INVENTREE_API_VERSION
|
||||||
|
|
||||||
# InvenTree software version
|
# InvenTree software version
|
||||||
INVENTREE_SW_VERSION = "0.11.0"
|
INVENTREE_SW_VERSION = "0.11.2"
|
||||||
|
|
||||||
|
|
||||||
def inventreeInstanceName():
|
def inventreeInstanceName():
|
||||||
|
|||||||
@@ -390,7 +390,7 @@
|
|||||||
});
|
});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if roles.salse_order.add %}
|
{% if roles.sales_order.add %}
|
||||||
$("#new-sales-order").click(function() {
|
$("#new-sales-order").click(function() {
|
||||||
|
|
||||||
createSalesOrder({
|
createSalesOrder({
|
||||||
|
|||||||
@@ -130,6 +130,7 @@
|
|||||||
{% endblock page_content %}
|
{% endblock page_content %}
|
||||||
|
|
||||||
{% block js_ready %}
|
{% block js_ready %}
|
||||||
|
{% settings_value "PURCHASEORDER_EDIT_COMPLETED_ORDERS" as allow_extra_editing %}
|
||||||
|
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
|
|
||||||
@@ -174,7 +175,7 @@
|
|||||||
filterkey: "postock"
|
filterkey: "postock"
|
||||||
});
|
});
|
||||||
|
|
||||||
{% if order.status == PurchaseOrderStatus.PENDING %}
|
{% if order.is_open or allow_extra_editing %}
|
||||||
$('#new-po-line').click(function() {
|
$('#new-po-line').click(function() {
|
||||||
|
|
||||||
createPurchaseOrderLineItem({{ order.pk }}, {
|
createPurchaseOrderLineItem({{ order.pk }}, {
|
||||||
|
|||||||
@@ -1188,6 +1188,11 @@ class StockTrackingList(ListAPI):
|
|||||||
"""List all stock tracking entries."""
|
"""List all stock tracking entries."""
|
||||||
queryset = self.filter_queryset(self.get_queryset())
|
queryset = self.filter_queryset(self.get_queryset())
|
||||||
|
|
||||||
|
page = self.paginate_queryset(queryset)
|
||||||
|
|
||||||
|
if page is not None:
|
||||||
|
serializer = self.get_serializer(page, many=True)
|
||||||
|
else:
|
||||||
serializer = self.get_serializer(queryset, many=True)
|
serializer = self.get_serializer(queryset, many=True)
|
||||||
|
|
||||||
data = serializer.data
|
data = serializer.data
|
||||||
@@ -1262,6 +1267,8 @@ class StockTrackingList(ListAPI):
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if page is not None:
|
||||||
|
return self.get_paginated_response(data)
|
||||||
if request.is_ajax():
|
if request.is_ajax():
|
||||||
return JsonResponse(data, safe=False)
|
return JsonResponse(data, safe=False)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -76,7 +76,11 @@ function formatPriceRange(price_min, price_max, options={}) {
|
|||||||
var p_min = price_min || price_max;
|
var p_min = price_min || price_max;
|
||||||
var p_max = price_max || price_min;
|
var p_max = price_max || price_min;
|
||||||
|
|
||||||
var quantity = options.quantity || 1;
|
var quantity = 1;
|
||||||
|
|
||||||
|
if ('quantity' in options) {
|
||||||
|
quantity = options.quantity;
|
||||||
|
}
|
||||||
|
|
||||||
if (p_min == null && p_max == null) {
|
if (p_min == null && p_max == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1056,9 +1056,8 @@ function allocateStockToSalesOrder(order_id, line_items, options={}) {
|
|||||||
var table_entries = '';
|
var table_entries = '';
|
||||||
|
|
||||||
for (var idx = 0; idx < line_items.length; idx++ ) {
|
for (var idx = 0; idx < line_items.length; idx++ ) {
|
||||||
var line_item = line_items[idx];
|
let line_item = line_items[idx];
|
||||||
|
let remaining = Math.max(0, line_item.quantity - line_item.allocated);
|
||||||
var remaining = 0;
|
|
||||||
|
|
||||||
table_entries += renderLineItemRow(line_item, remaining);
|
table_entries += renderLineItemRow(line_item, remaining);
|
||||||
}
|
}
|
||||||
@@ -1225,7 +1224,7 @@ function allocateStockToSalesOrder(order_id, line_items, options={}) {
|
|||||||
var available = Math.max((data.quantity || 0) - (data.allocated || 0), 0);
|
var available = Math.max((data.quantity || 0) - (data.allocated || 0), 0);
|
||||||
|
|
||||||
// Remaining quantity to be allocated?
|
// Remaining quantity to be allocated?
|
||||||
var remaining = Math.max(line_item.quantity - line_item.shipped - line_item.allocated, 0);
|
var remaining = Math.max(line_item.quantity - line_item.allocated, 0);
|
||||||
|
|
||||||
// Maximum amount that we need
|
// Maximum amount that we need
|
||||||
var desired = Math.min(available, remaining);
|
var desired = Math.min(available, remaining);
|
||||||
@@ -1892,7 +1891,7 @@ function loadSalesOrderLineItemTable(table, options={}) {
|
|||||||
if (row.part && row.part_detail) {
|
if (row.part && row.part_detail) {
|
||||||
let part = row.part_detail;
|
let part = row.part_detail;
|
||||||
|
|
||||||
if (options.allow_edit && !row.shipped) {
|
if (options.allow_edit && (row.shipped < row.quantity)) {
|
||||||
if (part.trackable) {
|
if (part.trackable) {
|
||||||
buttons += makeIconButton('fa-hashtag icon-green', 'button-add-by-sn', pk, '{% trans "Allocate serial numbers" %}');
|
buttons += makeIconButton('fa-hashtag icon-green', 'button-add-by-sn', pk, '{% trans "Allocate serial numbers" %}');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2063,6 +2063,10 @@ function loadStockTable(table, options) {
|
|||||||
currency = baseCurrency();
|
currency = baseCurrency();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (row.quantity <= 0) {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
|
||||||
return formatPriceRange(
|
return formatPriceRange(
|
||||||
min_price,
|
min_price,
|
||||||
max_price,
|
max_price,
|
||||||
|
|||||||
Reference in New Issue
Block a user