diff --git a/kfet/templates/kfet/inventory_create.html b/kfet/templates/kfet/inventory_create.html index 61792c6d..1098f1f8 100644 --- a/kfet/templates/kfet/inventory_create.html +++ b/kfet/templates/kfet/inventory_create.html @@ -101,7 +101,7 @@ $(document).ready(function() { * Remove warning and update stock */ - function update_stock($line) { + function update_stock($line, update_count) { $line.removeClass('inventory_modified'); $line.find('.inventory_update').hide(); @@ -110,7 +110,7 @@ $(document).ready(function() { $line.find('.current_stock').text(old_stock + stock_diff); $line.find('.stock_diff').text(''); - if ($line.find('.stock_new input').val() && stock_diff) { + if ($line.find('.stock_new input').val() && update_count) { var old_misc = +$line.find('.misc input').val(); $line.find('.misc input').val(old_misc + stock_diff) .trigger('input'); @@ -122,12 +122,12 @@ $(document).ready(function() { $('.finished input').change(function() { var $line = $(this).closest('tr'); - update_stock($line); + update_stock($line, false); }); $('.inventory_update button').click(function() { var $line = $(this).closest('tr'); - update_stock($line); + update_stock($line, true); });