Module: Crm::Reports::ConversionReportHelper

Defined in:
app/helpers/crm/reports/conversion_report_helper.rb

Instance Method Summary collapse

Instance Method Details

#cr_metric_cells(row) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/crm/reports/conversion_report_helper.rb', line 2

def cr_metric_cells(row)
  safe_join([
    (:td, values_format_without_symbol(row[:opps_created_prev].to_i), class: 'text-end font-monospace border-start'),
    (:td, values_format_without_symbol(row[:opps_created_cur].to_i), class: 'text-end font-monospace'),
    (:td, value_ptg(row[:opps_growth].to_i),
                class: "text-end font-monospace#{' text-danger' if row[:opps_growth].to_f.negative?}"),
    (:td, values_format_without_symbol(row[:opps_won_prev].to_i), class: 'text-end font-monospace border-start col-shaded'),
    (:td, values_format_without_symbol(row[:opps_won_cur].to_i), class: 'text-end font-monospace col-shaded'),
    (:td, values_format_without_symbol(row[:opp_won_var].to_i),
                class: "text-end font-monospace col-shaded#{' text-danger' if row[:opp_won_var].to_i.negative?}"),
    (:td, value_ptg(row[:conversion_rate_prev].to_i), class: 'text-end font-monospace border-start'),
    (:td, value_ptg(row[:conversion_rate_cur].to_i), class: 'text-end font-monospace'),
    (:td, value_ptg(row[:conversion_rate_var].to_i),
                class: "text-end font-monospace#{' text-danger' if row[:conversion_rate_var].to_f.negative?}"),
    (:td, values_format_without_symbol(row[:avg_closing_time_prev].to_i), class: 'text-end font-monospace border-start col-shaded'),
    (:td, values_format_without_symbol(row[:avg_closing_time_cur].to_i), class: 'text-end font-monospace col-shaded'),
    (:td, values_format_without_symbol(row[:avg_closing_time_var].to_i),
                class: "text-end font-monospace col-shaded#{' text-success' if row[:avg_closing_time_var].to_i.negative?}")
  ])
end

#cr_total_cells(row) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'app/helpers/crm/reports/conversion_report_helper.rb', line 23

def cr_total_cells(row)
  safe_join([
    (:td, (:strong, values_format_without_symbol(row[:opps_created_prev].to_i)), class: 'text-end font-monospace border-start'),
    (:td, (:strong, values_format_without_symbol(row[:opps_created_cur].to_i)), class: 'text-end font-monospace'),
    (:td, (:strong, value_ptg(row[:opps_growth].to_i)),
                class: "text-end font-monospace#{' text-danger' if row[:opps_growth].to_f.negative?}"),
    (:td, (:strong, values_format_without_symbol(row[:opps_won_prev].to_i)), class: 'text-end font-monospace border-start col-shaded'),
    (:td, (:strong, values_format_without_symbol(row[:opps_won_cur].to_i)), class: 'text-end font-monospace col-shaded'),
    (:td, (:strong, values_format_without_symbol(row[:opp_won_var].to_i)),
                class: "text-end font-monospace col-shaded#{' text-danger' if row[:opp_won_var].to_i.negative?}"),
    (:td, (:strong, value_ptg(row[:conversion_rate_prev].to_i)), class: 'text-end font-monospace border-start'),
    (:td, (:strong, value_ptg(row[:conversion_rate_cur].to_i)), class: 'text-end font-monospace'),
    (:td, (:strong, value_ptg(row[:conversion_rate_var].to_i)),
                class: "text-end font-monospace#{' text-danger' if row[:conversion_rate_var].to_f.negative?}"),
    (:td, (:strong, values_format_without_symbol(row[:avg_closing_time_prev].to_i)), class: 'text-end font-monospace border-start col-shaded'),
    (:td, (:strong, values_format_without_symbol(row[:avg_closing_time_cur].to_i)), class: 'text-end font-monospace col-shaded'),
    (:td, (:strong, values_format_without_symbol(row[:avg_closing_time_var].to_i)),
                class: "text-end font-monospace col-shaded#{' text-success' if row[:avg_closing_time_var].to_i.negative?}")
  ])
end