Class: Crm::Reports::CustomerPerformanceController
- Inherits:
-
CrmController
- Object
- CrmController
- Crm::Reports::CustomerPerformanceController
- Includes:
- Controllers::ReportCommandFlashable
- Defined in:
- app/controllers/crm/reports/customer_performance_controller.rb
Overview
Controller: customer performance.
Instance Method Summary collapse
-
#pin_customers ⇒ Object
Tag customer and send to advanced search.
- #show ⇒ Object
Instance Method Details
#pin_customers ⇒ Object
Tag customer and send to advanced search
21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/crm/reports/customer_performance_controller.rb', line 21 def pin_customers se = CustomerSearch.new(query_params: { id_in: params[:customer_ids] }, employee_id: current_user.id) if se.save se.record_list('*') redirect_to search_path(se) else redirect_to :show, notice: "Could not create search, errors reported: #{se.errors_to_s}" end end |
#show ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/crm/reports/customer_performance_controller.rb', line 8 def show :read, Invoice @report_command = ::Report::CustomerPerformanceCommand.new(customer_performance_command_params) @results = @report_command.execute flash_report_command_errors respond_to do |format| format.html format.turbo_stream end end |