Module: Crm::Reports::OrdersReportHelper
- Defined in:
- app/helpers/crm/reports/orders_report_helper.rb
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
20 21 22 23 24 25 26 27 28 |
# File 'app/helpers/crm/reports/orders_report_helper.rb', line 20 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
30 31 32 33 34 35 36 37 38 |
# File 'app/helpers/crm/reports/orders_report_helper.rb', line 30 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
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/helpers/crm/reports/orders_report_helper.rb', line 2 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 content_tag(:i, "", class: "fa-solid fa-arrow-up fa-xs me-1") + "#{var_value} %" end elsif var_value.negative? content_tag(:span, class: "text-danger") do content_tag(:i, "", class: "fa-solid fa-arrow-down fa-xs me-1") + "#{var_value} %" end else content_tag(:span, "-", class: "text-muted") end end |