|
44 | 44 | :initial_interval, :next_interval, |
45 | 45 | :use_dp_intervals, |
46 | 46 | :initial_rate, :next_rate, :connect_fee, |
| 47 | + [:currency_name, proc { |row| row.currency.name }], |
47 | 48 | :dp_margin_fixed, :dp_margin_percent, |
48 | 49 | :profit_control_mode_name, |
49 | 50 | :valid_from, :valid_till, |
|
108 | 109 | :dp_margin_percent, :rate_policy_id, :reverse_billing, :initial_rate, |
109 | 110 | :reject_calls, :use_dp_intervals, :test, :profit_control_mode_id, |
110 | 111 | :valid_from, :valid_till, :asr_limit, :acd_limit, :short_calls_limit, :batch_prefix, |
111 | | - :reverse_billing, :routing_tag_mode_id, :allow_package_billing, :scheduler_id, routing_tag_ids: [] |
| 112 | + :reverse_billing, :routing_tag_mode_id, :allow_package_billing, :scheduler_id, :currency_id, routing_tag_ids: [] |
112 | 113 |
|
113 | 114 | action_item :show_rates, only: [:show] do |
114 | 115 | link_to 'Show Rates', destination_destination_next_rates_path(resource.id) |
@@ -136,7 +137,7 @@ def update |
136 | 137 | # |
137 | 138 | # preload have more controllable behavior, but sorting by associated tables not possible |
138 | 139 | def scoped_collection |
139 | | - super.preload(:rate_group, network_prefix: %i[country network]) |
| 140 | + super.preload(:rate_group, :currency, network_prefix: %i[country network]) |
140 | 141 | end |
141 | 142 | end |
142 | 143 |
|
@@ -176,15 +177,11 @@ def scoped_collection |
176 | 177 | column :valid_till, &:decorated_valid_till |
177 | 178 |
|
178 | 179 | column :rate_policy, &:rate_policy_name |
179 | | - column :reverse_billing |
180 | 180 | column :allow_package_billing |
181 | 181 |
|
182 | 182 | ## fixed price |
183 | | - column :initial_interval |
184 | | - column :initial_rate |
185 | | - column :next_interval |
186 | | - column :next_rate |
187 | | - column :connect_fee |
| 183 | + column :rates, &:decorated_rates |
| 184 | + column :intervals, &:decorated_intervals |
188 | 185 | column :use_dp_intervals |
189 | 186 |
|
190 | 187 | # cost + X ( $ or % ) |
@@ -241,6 +238,7 @@ def scoped_collection |
241 | 238 | end |
242 | 239 | end |
243 | 240 | f.inputs 'Fixed rating configuration' do |
| 241 | + f.input :currency, as: :select, include_blank: false, input_html: { class: 'tom-select' } |
244 | 242 | f.input :initial_rate |
245 | 243 | f.input :next_rate |
246 | 244 | f.input :connect_fee |
@@ -301,6 +299,9 @@ def scoped_collection |
301 | 299 | end |
302 | 300 | panel 'Fixed rating configuration' do |
303 | 301 | attributes_table_for s do |
| 302 | + row :currency do |
| 303 | + status_tag s.currency.name |
| 304 | + end |
304 | 305 | row :initial_rate |
305 | 306 | row :next_rate |
306 | 307 | row :connect_fee |
|
0 commit comments