mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Fix for sales order tables (#4753)
- Allow line items to be allocated after partial shipment - Fixes https://github.com/inventree/InvenTree/issues/4734
This commit is contained in:
parent
be735e4568
commit
3ff217d229
@ -1078,9 +1078,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);
|
||||||
}
|
}
|
||||||
@ -1247,7 +1246,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);
|
||||||
@ -1914,7 +1913,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" %}');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user