From 002c047105c23355de270b4d2d6c44666d4e3301 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 8 May 2018 22:14:18 +1000 Subject: [PATCH] Added count/add/remove to Part Stock Detail Page --- InvenTree/part/templates/part/stock.html | 27 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/InvenTree/part/templates/part/stock.html b/InvenTree/part/templates/part/stock.html index 76d6e846ba..f86822f53c 100644 --- a/InvenTree/part/templates/part/stock.html +++ b/InvenTree/part/templates/part/stock.html @@ -16,8 +16,10 @@ @@ -110,16 +112,29 @@ return false; }); - $("#multi-item-stocktake").click(function() { - var items = selectedStock(); - - countStockItems(items, { + function _stock(action) { + adjustStock({ + action: action, + items: selectedStock(), success: function() { - $("#stock-table").bootstrapTable('refresh'); + $('#stock-table').bootstrapTable('refresh'); } }); + } + $("#multi-item-stocktake").click(function() { + _stock('stocktake'); return false; }); + $("#multi-item-take").click(function() { + _stock('remove'); + return false; + }); + + $("#multi-item-give").click(function() { + _stock('add'); + return false; + }) + {% endblock %} \ No newline at end of file