Compare commits

...

7 Commits

Author SHA1 Message Date
Oliver
4868194a0b Fix for PurchaseOrder template (#4891)
- Fixes bug which removes javascript incorrectly
2023-05-25 09:39:55 +10:00
Oliver
53e442f555 Sales order fix backport (#4879)
* Bump version to 0.11.2

* Fix for sales order tables (#4753)

- Allow line items to be allocated after partial shipment
- Fixes https://github.com/inventree/InvenTree/issues/4734
2023-05-24 00:38:00 +10:00
Oliver
9f6d860554 Bump version to 0.11.2 (#4878) 2023-05-24 00:37:40 +10:00
Oliver
a1908f1bf1 Fix "New Sales Order" button (#4832) 2023-05-17 14:48:31 +10:00
Oliver
c29e58aeaa Bug fix for zero quantity pricing (#4766)
- Fix default value for formatPriceRange method
- Display empty value in table

(cherry picked from commit 07d9c2264e)
2023-05-05 22:40:20 +10:00
Oliver
fdaf6d3e19 Implement pagination for stock history tracking API (#4631)
* Bump version number to 0.11.1

* Implement pagination for stock history tracking API

(cherry picked from commit 75696770c6)
2023-04-19 07:09:08 +10:00
Oliver
78badcd65b Bump version number to 0.11.1 (#4630) 2023-04-18 22:56:35 +10:00
7 changed files with 25 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ import common.models
from InvenTree.api_version import INVENTREE_API_VERSION
# InvenTree software version
INVENTREE_SW_VERSION = "0.11.0"
INVENTREE_SW_VERSION = "0.11.2"
def inventreeInstanceName():

View File

@@ -390,7 +390,7 @@
});
{% endif %}
{% if roles.salse_order.add %}
{% if roles.sales_order.add %}
$("#new-sales-order").click(function() {
createSalesOrder({

View File

@@ -130,6 +130,7 @@
{% endblock page_content %}
{% block js_ready %}
{% settings_value "PURCHASEORDER_EDIT_COMPLETED_ORDERS" as allow_extra_editing %}
{{ block.super }}
@@ -174,7 +175,7 @@
filterkey: "postock"
});
{% if order.status == PurchaseOrderStatus.PENDING %}
{% if order.is_open or allow_extra_editing %}
$('#new-po-line').click(function() {
createPurchaseOrderLineItem({{ order.pk }}, {

View File

@@ -1188,7 +1188,12 @@ class StockTrackingList(ListAPI):
"""List all stock tracking entries."""
queryset = self.filter_queryset(self.get_queryset())
serializer = self.get_serializer(queryset, many=True)
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)
data = serializer.data
@@ -1262,6 +1267,8 @@ class StockTrackingList(ListAPI):
except Exception:
pass
if page is not None:
return self.get_paginated_response(data)
if request.is_ajax():
return JsonResponse(data, safe=False)
else:

View File

@@ -76,7 +76,11 @@ function formatPriceRange(price_min, price_max, options={}) {
var p_min = price_min || price_max;
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) {
return null;

View File

@@ -1056,9 +1056,8 @@ function allocateStockToSalesOrder(order_id, line_items, options={}) {
var table_entries = '';
for (var idx = 0; idx < line_items.length; idx++ ) {
var line_item = line_items[idx];
var remaining = 0;
let line_item = line_items[idx];
let remaining = Math.max(0, line_item.quantity - line_item.allocated);
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);
// 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
var desired = Math.min(available, remaining);
@@ -1892,7 +1891,7 @@ function loadSalesOrderLineItemTable(table, options={}) {
if (row.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) {
buttons += makeIconButton('fa-hashtag icon-green', 'button-add-by-sn', pk, '{% trans "Allocate serial numbers" %}');
}

View File

@@ -2063,6 +2063,10 @@ function loadStockTable(table, options) {
currency = baseCurrency();
}
if (row.quantity <= 0) {
return '-';
}
return formatPriceRange(
min_price,
max_price,