Skip to content

Commit

Permalink
Merge pull request #3129 from hstastna/Form_add_chargeback_rate_impro…
Browse files Browse the repository at this point in the history
…per_ids

Fix issues related to adding, editing Chargeback Rates
(cherry picked from commit 5cd68c7)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1533924
  • Loading branch information
Dan Clarizio authored and simaishi committed Jan 12, 2018
1 parent 812b96d commit db13d23
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/views/chargeback/_cb_rate_edit_table.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
%th= _("Fixed")
%th= _("Variable")
%tbody
- @edit[:new][:details].sort_by { |rd| [rd[:group], rd[:description], rd[:sub_metric].to_s] }.each do |detail|
- @edit[:new][:details].sort_by { |rd| [rd[:group], rd[:description], rd[:sub_metric].to_s] }.each_with_index do |detail, detail_index|
- @cur_group = detail[:group] if @cur_group.nil?
- if @cur_group != detail[:group]
- @cur_group = detail[:group]
%tr
%td{:colspan => "10", :style => "background-color: #f5f5f5;"}  
- detail_index = @edit[:new][:tiers].index { |x| x.detect { |tier_hash| tier_hash['chargeback_rate_detail_id'] == detail[:id] }.present? }
- if params[:pressed] == "chargeback_rates_edit"
- detail_index = @edit[:new][:tiers].index { |x| x.detect { |tier_hash| tier_hash['chargeback_rate_detail_id'] == detail[:id] }.present? }
- num_tiers = @edit[:new][:tiers][detail_index].blank? ? "1" : @edit[:new][:tiers][detail_index].length.to_s

%tr.rdetail{:id => "rate_detail_row_#{detail_index}_0"}
Expand Down

0 comments on commit db13d23

Please sign in to comment.