2
0
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:
Oliver Walters
2019-04-17 23:17:04 +10:00
parent ba1b8d9181
commit 963883acd6
3 changed files with 57 additions and 26 deletions

View File

@ -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;
});