2021-03-30 14:30:17 +00:00
|
|
|
<% headers = [
|
|
|
|
I18n.t('reports.agent_csv.agent_name'),
|
|
|
|
I18n.t('reports.agent_csv.conversations_count'),
|
|
|
|
I18n.t('reports.agent_csv.avg_first_response_time'),
|
|
|
|
I18n.t('reports.agent_csv.avg_resolution_time')
|
|
|
|
]
|
|
|
|
%>
|
2020-11-16 14:11:52 +00:00
|
|
|
<%= CSV.generate_line headers %>
|
|
|
|
<% Current.account.users.each do |agent| %>
|
|
|
|
<% agent_report = V2::ReportBuilder.new(Current.account, {
|
|
|
|
type: :agent,
|
|
|
|
id: agent.id,
|
|
|
|
since: params[:since],
|
|
|
|
until: params[:until]
|
|
|
|
}).summary %>
|
|
|
|
<% row = [ agent.name, agent_report[:conversations_count], (agent_report[:avg_first_response_time]/60).to_i, (agent_report[:avg_resolution_time]/60).to_i ] %>
|
2020-12-15 18:05:03 +00:00
|
|
|
<%= CSV.generate_line row %>
|
|
|
|
<% end %>
|
2021-08-03 14:41:52 +00:00
|
|
|
<%= CSV.generate_line [I18n.t('reports.period', since: Date.strptime(params[:since], '%s'), until: Date.strptime(params[:until], '%s'))] %>
|