diff --git a/app/controllers/report_controller/reports/editor.rb b/app/controllers/report_controller/reports/editor.rb index 1924006cc1ba..573678e36c70 100644 --- a/app/controllers/report_controller/reports/editor.rb +++ b/app/controllers/report_controller/reports/editor.rb @@ -597,6 +597,8 @@ def gfv_chargeback @edit[:new][:cb_tag_cat] = params[:cb_tag_cat] @edit[:cb_tags] = entries_hash(params[:cb_tag_cat]) end + elsif params.key?(:cb_without_metric_rollups) + @edit[:new][:cb_without_metric_rollups] = params[:cb_without_metric_rollups] == 'true' elsif params.key?(:cb_owner_id) @edit[:new][:cb_owner_id] = params[:cb_owner_id].blank? ? nil : params[:cb_owner_id] elsif params.key?(:cb_tenant_id) @@ -988,6 +990,7 @@ def set_record_vars(rpt) options[:entity_id] = @edit[:new][:cb_entity_id] end + options[:without_metric_rollups] = @edit[:new][:cb_without_metric_rollups] options[:groupby] = @edit[:new][:cb_groupby] options[:groupby_tag] = @edit[:new][:cb_groupby] == 'tag' ? @edit[:new][:cb_groupby_tag] : nil @@ -1266,6 +1269,7 @@ def set_form_vars @edit[:new][:cb_provider_id] = options[:provider_id] end + @edit[:new][:cb_without_metric_rollups] = options[:without_metric_rollups] @edit[:new][:cb_groupby_tag] = options[:groupby_tag] if options.key?(:groupby_tag) @edit[:new][:cb_model] = Chargeback.report_cb_model(@rpt.db) @edit[:new][:cb_interval] = options[:interval] diff --git a/app/views/report/_form_filter_chargeback.html.haml b/app/views/report/_form_filter_chargeback.html.haml index 7bfd9233aca2..bd5d6367c472 100644 --- a/app/views/report/_form_filter_chargeback.html.haml +++ b/app/views/report/_form_filter_chargeback.html.haml @@ -1,4 +1,17 @@ - url = url_for(:action => 'form_field_changed', :id => "#{@edit[:rpt_id] || 'new'}") +- if @edit[:new][:model] == "ChargebackVm" + %h3 + = _('Chargeback Resources') + .form-horizontal + .form-group + %label.control-label.col-md-2 + = _('Generate report without using capacity and utilization data for allocated resources') + .col-md-8 + = check_box_tag("cb_without_metric_rollups", true, @edit[:new][:cb_without_metric_rollups], + "data-miq_sparkle_on" => true, "data-miq_sparkle_off" => true, + :data => {:on_text => _('Yes'), :off_text => _('No')}) + :javascript + miqInitBootstrapSwitch('cb_without_metric_rollups', "#{url}") %h3 = _('Chargeback Filters') .form-horizontal