Class: Crm::Reports::KpiTimeOnTaskController

Inherits:
CrmController
  • Object
show all
Includes:
Controllers::ReportCommandFlashable
Defined in:
app/controllers/crm/reports/kpi_time_on_task_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/crm/reports/kpi_time_on_task_controller.rb', line 6

def show
  authorize! :read, CallLog
  @report_command = ::Report::KpiTimeOnTask::KpiTimeOnTaskCommand.new(kpi_time_on_task_command_params)
  @results = @report_command.execute

  flash_report_command_errors
  respond_to do |format|
    format.html
    format.turbo_stream
    format.csv { send_data @report_command.to_csv, filename: "kpi-time-on-task-#{Date.current}.csv" }
  end
end