diff --git a/app/assets/javascripts/my_modules/stock.js b/app/assets/javascripts/my_modules/stock.js index 2b689ceef..f15d67e73 100644 --- a/app/assets/javascripts/my_modules/stock.js +++ b/app/assets/javascripts/my_modules/stock.js @@ -35,7 +35,7 @@ var MyModuleStockConsumption = (function() { let finalValue = initialValue - ($(this).val() || 0) + initialStock; $('.stock-final-container .value') .text(formatDecimalValue(String(finalValue), $('#stock_consumption').data('decimals'))); - $('.stock-final-container').toggleClass('error', finalValue <= 0); + $('.stock-final-container').toggleClass('negative', finalValue <= 0); $(this).closest('.sci-input-container').toggleClass('error', this.value === ''); $('.update-consumption-button').attr('disabled', $(this).val() === ''); }); diff --git a/app/views/my_modules/repositories/_consume_stock_modal_content.html.erb b/app/views/my_modules/repositories/_consume_stock_modal_content.html.erb index ac2d6949f..392ffa075 100644 --- a/app/views/my_modules/repositories/_consume_stock_modal_content.html.erb +++ b/app/views/my_modules/repositories/_consume_stock_modal_content.html.erb @@ -34,7 +34,7 @@