2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Assign multiple stock items to a customer at one

This commit is contained in:
Oliver
2021-12-09 00:32:50 +11:00
parent 96a885e4e1
commit 4a453b0a35
4 changed files with 21 additions and 4 deletions

View File

@ -651,7 +651,7 @@ function assignStockToCustomer(items, options={}) {
// Does the row exist in the form?
var row = $(opts.modal).find(`#stock_item_${pk}`);
if (row) {
if (row.exists()) {
item_pk_values.push(pk);
data.items.push({
@ -931,7 +931,7 @@ function adjustStock(action, items, options={}) {
// Does the row exist in the form?
var row = $(opts.modal).find(`#stock_item_${pk}`);
if (row) {
if (row.exists()) {
item_pk_values.push(pk);
@ -1875,6 +1875,17 @@ function loadStockTable(table, options) {
stockAdjustment('move');
});
$('#multi-item-assign').click(function() {
var items = $(table).bootstrapTable('getSelections');
assignStockToCustomer(items, {
success: function() {
$(table).bootstrapTable('refresh');
}
});
});
$('#multi-item-order').click(function() {
var selections = $(table).bootstrapTable('getSelections');

View File

@ -50,6 +50,7 @@
<li><a class='dropdown-item' href="#" id='multi-item-stocktake' title='{% trans "Stocktake selected stock items" %}'><span class='fas fa-check-circle'></span> {% trans "Count stock" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-item-move' title='{% trans "Move selected stock items" %}'><span class='fas fa-exchange-alt'></span> {% trans "Move stock" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-item-order' title='{% trans "Order selected items" %}'><span class='fas fa-shopping-cart'></span> {% trans "Order stock" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-item-assign' title='{% trans "Assign to customer" %}'><span class='fas fa-user-tie'></span> {% trans "Assign to customer" %}</a></li>
<li><a class='dropdown-item' href='#' id='multi-item-set-status' title='{% trans "Change status" %}'><span class='fas fa-exclamation-circle'></span> {% trans "Change stock status" %}</a></li>
{% endif %}
{% if roles.stock.delete %}