Class: Crm::Reports::OpportunitiesReportController
- Inherits:
-
CrmController
- Object
- CrmController
- Crm::Reports::OpportunitiesReportController
- Includes:
- Controllers::ReportCommandFlashable
- Defined in:
- app/controllers/crm/reports/opportunities_report_controller.rb
Instance Method Summary collapse
- #existing_closed_pin_opportunities ⇒ Object
- #existing_open_pin_opportunities ⇒ Object
- #new_closed_pin_opportunities ⇒ Object
-
#new_open_pin_opportunities ⇒ Object
Tag customer and send to advanced search.
- #show ⇒ Object
Instance Method Details
#existing_closed_pin_opportunities ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'app/controllers/crm/reports/opportunities_report_controller.rb', line 48 def existing_closed_pin_opportunities se = OpportunitySearch.new(query_params: { id_in: params[:opportunity_ids] }, employee_id: current_user.id) if se.save se.record_list('*') #select all redirect_to search_path(se) else redirect_to :show, notice: "Could not create search, errors reported: #{se.errors_to_s}" end end |
#existing_open_pin_opportunities ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'app/controllers/crm/reports/opportunities_report_controller.rb', line 38 def existing_open_pin_opportunities se = OpportunitySearch.new(query_params: { id_in: params[:opportunity_ids] }, employee_id: current_user.id) if se.save se.record_list('*') #select all redirect_to search_path(se) else redirect_to :show, notice: "Could not create search, errors reported: #{se.errors_to_s}" end end |
#new_closed_pin_opportunities ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/crm/reports/opportunities_report_controller.rb', line 28 def new_closed_pin_opportunities se = OpportunitySearch.new(query_params: { id_in: params[:opportunity_ids] }, employee_id: current_user.id) if se.save se.record_list('*') #select all redirect_to search_path(se) else redirect_to :show, notice: "Could not create search, errors reported: #{se.errors_to_s}" end end |
#new_open_pin_opportunities ⇒ Object
Tag customer and send to advanced search
18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/crm/reports/opportunities_report_controller.rb', line 18 def new_open_pin_opportunities se = OpportunitySearch.new(query_params: { id_in: params[:opportunity_ids] }, employee_id: current_user.id) if se.save se.record_list('*') #select all redirect_to search_path(se) else redirect_to :show, notice: "Could not create search, errors reported: #{se.errors_to_s}" end end |
#show ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/crm/reports/opportunities_report_controller.rb', line 6 def show @report_command = ::Report::OpportunitiesReport::OpportunitiesReportCommand.new(opportunities_report_command_params) @result = @report_command.execute flash_report_command_errors respond_to do |format| format.html format.turbo_stream end end |