Class: Crm::Reports::SmartServicesController
- Inherits:
-
CrmController
- Object
- CrmController
- Crm::Reports::SmartServicesController
- Includes:
- Controllers::ReportCommandFlashable
- Defined in:
- app/controllers/crm/reports/smart_services_controller.rb
Overview
Controller: smart services.
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/crm/reports/smart_services_controller.rb', line 8 def show @report_command = ::Report::SmartServices::SmartServicesCommand.new(smart_services_command_params) @result = @report_command.execute flash_report_command_errors respond_to do |format| format.html format.turbo_stream format.csv do send_data @report_command.to_smart_services_by_report_grouping_csv, filename: "smart-services-sales-by-report-grouping-#{Date.current}.csv" if params[:report] == 'by_report_grouping' send_data @report_command.to_smart_services_by_rep_csv, filename: "smart-services-sales-by-rep-#{Date.current}.csv" if params[:report] == 'by_rep' end end end |