diff --git a/app/controllers/admin/enterprise_fees_controller.rb b/app/controllers/admin/enterprise_fees_controller.rb index 2b4852a613..ad17c5d90d 100644 --- a/app/controllers/admin/enterprise_fees_controller.rb +++ b/app/controllers/admin/enterprise_fees_controller.rb @@ -35,6 +35,13 @@ module Admin end def bulk_update + @flat_percent_value = enterprise_fee_bulk_params.dig('collection_attributes', '0', 'calculator_attributes', 'preferred_flat_percent') + + unless @flat_percent_value.nil? || Float(@flat_percent_value, exception: false) + flash[:error] = I18n.t(:calculator_preferred_value_error) + return redirect_to redirect_path + end + @enterprise_fee_set = Sets::EnterpriseFeeSet.new(enterprise_fee_bulk_params) if @enterprise_fee_set.save