From b113a57b741bf05aa59ee554a73b1ce40f9aba45 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Mon, 3 Apr 2017 11:20:56 -0300 Subject: [PATCH] Fix update function --- kfet/templates/kfet/inventory_create.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kfet/templates/kfet/inventory_create.html b/kfet/templates/kfet/inventory_create.html index 293bcd6b..29bf2d3e 100644 --- a/kfet/templates/kfet/inventory_create.html +++ b/kfet/templates/kfet/inventory_create.html @@ -110,14 +110,14 @@ $(document).ready(function() { $line.find('.current_stock').text(old_stock + stock_diff); $line.find('.stock_diff').text(''); - if ($line.find('.stock_new input').val()) { + if ($line.find('.stock_new input').val() && stock_diff) { var old_misc = +$line.find('.misc input').val(); $line.find('.misc input').val(old_misc + stock_diff) .trigger('input'); } var id = $line.find('input[type="hidden"]').val(); - conflicts = conflicts.delete(id); + conflicts.delete(parseInt(id)); } $('.finished input').change(function() {