forked from DGNum/gestioCOF
Don't update input when unchecking
This commit is contained in:
parent
f46ba0dd6c
commit
32474a6865
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue