Class: Search::OrderTextPresenter
- Inherits:
-
OrderPresenter
- Object
- OrderPresenter
- Search::OrderTextPresenter
- Defined in:
- app/presenters/search/order_text_presenter.rb
Overview
Presenter: order text presenter.
Delegated Instance Attributes collapse
-
#estimated_cost ⇒ Object
Alias for R#estimated_cost.
Instance Method Summary collapse
- #contact_link ⇒ Object
- #customer_link ⇒ Object
- #gross_revenue ⇒ Object
- #msrp ⇒ Object
- #notes_indicator ⇒ Object
- #order_link ⇒ Object
-
#revenue_consolidated_at_time_of_checkout ⇒ Object
order.revenue_consolidated_at_time_of_checkout should NEVER be nil, but hey it happens, very rarely, for no explicable reason, the fix is to set it to order.total.
- #spiff_rep_link ⇒ Object
- #total_revenue ⇒ Object
Instance Method Details
#contact_link ⇒ Object
18 19 20 21 22 |
# File 'app/presenters/search/order_text_presenter.rb', line 18 def contact_link return unless r.has_columns?(:contact_full_name, :contact_id) r.contact_full_name.to_s end |
#customer_link ⇒ Object
6 7 8 9 10 |
# File 'app/presenters/search/order_text_presenter.rb', line 6 def customer_link return unless r.has_columns?(:customer_full_name, :customer_id) "#{r.customer_full_name} (CN#{r.customer_id})" end |
#estimated_cost ⇒ Object
Alias for R#estimated_cost
32 |
# File 'app/presenters/search/order_text_presenter.rb', line 32 delegate :estimated_cost, to: :r |
#gross_revenue ⇒ Object
26 |
# File 'app/presenters/search/order_text_presenter.rb', line 26 def gross_revenue = r.line_total || 0.00 |
#msrp ⇒ Object
30 |
# File 'app/presenters/search/order_text_presenter.rb', line 30 def msrp = r.line_total_msrp || 0.00 |
#notes_indicator ⇒ Object
24 |
# File 'app/presenters/search/order_text_presenter.rb', line 24 def notes_indicator = h.text_only(r.notes) |
#order_link ⇒ Object
4 |
# File 'app/presenters/search/order_text_presenter.rb', line 4 def order_link = r.reference_number || "Cart id #{r.id}" |
#revenue_consolidated_at_time_of_checkout ⇒ Object
order.revenue_consolidated_at_time_of_checkout should NEVER be nil, but hey it happens, very rarely, for no explicable reason, the fix is to set it to order.total
35 |
# File 'app/presenters/search/order_text_presenter.rb', line 35 def revenue_consolidated_at_time_of_checkout = r.revenue_consolidated_at_time_of_checkout || r.total |
#spiff_rep_link ⇒ Object
12 13 14 15 16 |
# File 'app/presenters/search/order_text_presenter.rb', line 12 def spiff_rep_link return unless r.has_columns?(:spiff_rep_full_name, :spiff_rep_id) r.spiff_rep_full_name.to_s end |
#total_revenue ⇒ Object
28 |
# File 'app/presenters/search/order_text_presenter.rb', line 28 def total_revenue = r.total || 0.00 |