mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 05:25:42 +00:00
Consolidated function to adjust stock
- Add / remove / stocktake - Handle forms and tables properly
This commit is contained in:
@ -70,28 +70,24 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
function _stock(action) {
|
||||
adjustStock({
|
||||
action: action,
|
||||
items: selectedStock(),
|
||||
success: function() {
|
||||
$('#stock-table').bootstrapTable('refresh');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#multi-item-stocktake").click(function() {
|
||||
_stock('stocktake');
|
||||
updateStockItems({
|
||||
action: 'stocktake'
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#multi-item-take").click(function() {
|
||||
_stock('remove');
|
||||
updateStockItems({
|
||||
action: 'remove',
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#multi-item-give").click(function() {
|
||||
_stock('add');
|
||||
updateStockItems({
|
||||
action: 'add',
|
||||
});
|
||||
return false;
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user