Module: Crm::Reports::OrdersReportHelper
- Defined in:
- app/helpers/crm/reports/orders_report_helper.rb
Overview
View helper: orders report.
Instance Method Summary collapse
- #order_origin_values_format_of(value) ⇒ Object
- #order_origin_values_format_without_symbol_of(value) ⇒ Object
- #order_origin_var_percentage_of(var_value) ⇒ Object
Instance Method Details
#order_origin_values_format_of(value) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'app/helpers/crm/reports/orders_report_helper.rb', line 22 def order_origin_values_format_of(value) return content_tag(:span, "-", class: "text-muted") unless value if value.zero? content_tag(:span, "-", class: "text-muted") else humanized_money_with_symbol(value) end end |
#order_origin_values_format_without_symbol_of(value) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'app/helpers/crm/reports/orders_report_helper.rb', line 32 def order_origin_values_format_without_symbol_of(value) return content_tag(:span, "-", class: "text-muted") unless value if value.zero? content_tag(:span, "-", class: "text-muted") else number_with_delimiter(value) end end |
#order_origin_var_percentage_of(var_value) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/helpers/crm/reports/orders_report_helper.rb', line 4 def order_origin_var_percentage_of(var_value) return content_tag(:span, "-", class: "text-muted") unless var_value if var_value.positive? content_tag(:span, class: "text-success") do fa_icon("arrow-up", family: :solid, class: "fa-xs me-1") + "#{var_value} %" end elsif var_value.negative? content_tag(:span, class: "text-danger") do fa_icon("arrow-down", family: :solid, class: "fa-xs me-1") + "#{var_value} %" end else content_tag(:span, "-", class: "text-muted") end end |