mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 19:15:41 +00:00
Consolidated function to adjust stock
- Add / remove / stocktake - Handle forms and tables properly
This commit is contained in:
@ -136,28 +136,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-remove').click(function() {
|
||||
_stock('remove');
|
||||
updateStockItems({
|
||||
action: 'remove',
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#multi-item-add').click(function() {
|
||||
_stock('add');
|
||||
updateStockItems({
|
||||
action: 'add',
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user