From 0c212383917d983cdd53f5a98e45475a9082ecce Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Thu, 30 Mar 2017 18:39:13 -0300 Subject: [PATCH] Change misc field when updating --- kfet/templates/kfet/inventory_create.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kfet/templates/kfet/inventory_create.html b/kfet/templates/kfet/inventory_create.html index e88612c7..1273d869 100644 --- a/kfet/templates/kfet/inventory_create.html +++ b/kfet/templates/kfet/inventory_create.html @@ -111,6 +111,12 @@ $(document).ready(function() { var stock_diff = +$line.find('.stock_diff').text(); $line.find('.current_stock').text(old_stock + stock_diff); $line.find('.stock_diff').text(''); + + if ($line.find('.stock_new input').val()) { + 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.filter(item => item != id);