mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Pre-fill the form with the remaining allocation quantity
This commit is contained in:
parent
9fe1dd7be4
commit
f7b6c68237
@ -1641,6 +1641,13 @@ function loadSalesOrderLineItemTable(table, options={}) {
|
|||||||
|
|
||||||
var line_item = $(table).bootstrapTable('getRowByUniqueId', pk);
|
var line_item = $(table).bootstrapTable('getRowByUniqueId', pk);
|
||||||
|
|
||||||
|
// Quantity remaining to be allocated
|
||||||
|
var remaining = (line_item.quantity || 0) - (line_item.allocated || 0);
|
||||||
|
|
||||||
|
if (remaining < 0) {
|
||||||
|
remaining = 0;
|
||||||
|
}
|
||||||
|
|
||||||
var fields = {
|
var fields = {
|
||||||
// SalesOrderLineItem reference
|
// SalesOrderLineItem reference
|
||||||
line: {
|
line: {
|
||||||
@ -1657,6 +1664,7 @@ function loadSalesOrderLineItemTable(table, options={}) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
quantity: {
|
quantity: {
|
||||||
|
value: remaining,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user