diff --git a/modules/costs/app/forms/admin/cost_types/details_form.rb b/modules/costs/app/forms/admin/cost_types/details_form.rb index 6113d8c0eaf..87cd2a4e0b6 100644 --- a/modules/costs/app/forms/admin/cost_types/details_form.rb +++ b/modules/costs/app/forms/admin/cost_types/details_form.rb @@ -53,14 +53,15 @@ module Admin input_width: :medium ) - f.text_field( - name: :current_rate, - label: ::CostType.human_attribute_name(:current_rate), - input_width: :small, - inputmode: :decimal, - value: current_rate_value, - trailing_visual: { text: { text: Setting.costs_currency } } - ) + if model.new_record? + f.text_field( + name: :current_rate, + label: ::CostType.human_attribute_name(:current_rate), + input_width: :small, + inputmode: :decimal, + trailing_visual: { text: { text: Setting.costs_currency } } + ) + end f.check_box( name: :default, @@ -72,13 +73,6 @@ module Admin label: ::CostType.human_attribute_name(:for_all_projects) ) end - - def current_rate_value - rate = model.rate_at(Date.current) - return "" unless rate - - helpers.unitless_currency_number(rate.rate.round(2)) - end end end end