Class: Search::OrderTextPresenter
- Inherits:
-
OrderPresenter
- Object
- OrderPresenter
- Search::OrderTextPresenter
- Defined in:
- app/presenters/search/order_text_presenter.rb
Instance Method Summary collapse
- #contact_link ⇒ Object
- #customer_link ⇒ Object
- #estimated_cost ⇒ 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
15 16 17 18 |
# File 'app/presenters/search/order_text_presenter.rb', line 15 def contact_link return unless r.has_columns?(:contact_full_name, :contact_id) "#{r.contact_full_name}" end |
#customer_link ⇒ Object
5 6 7 8 |
# File 'app/presenters/search/order_text_presenter.rb', line 5 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
28 |
# File 'app/presenters/search/order_text_presenter.rb', line 28 def estimated_cost = r.estimated_cost |
#gross_revenue ⇒ Object
22 |
# File 'app/presenters/search/order_text_presenter.rb', line 22 def gross_revenue = (r.line_total || 0.00) |
#msrp ⇒ Object
26 |
# File 'app/presenters/search/order_text_presenter.rb', line 26 def msrp = (r.line_total_msrp || 0.00) |
#notes_indicator ⇒ Object
20 |
# File 'app/presenters/search/order_text_presenter.rb', line 20 def notes_indicator = h.text_only(r.notes) |
#order_link ⇒ Object
3 |
# File 'app/presenters/search/order_text_presenter.rb', line 3 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
30 |
# File 'app/presenters/search/order_text_presenter.rb', line 30 def revenue_consolidated_at_time_of_checkout = (r.revenue_consolidated_at_time_of_checkout || r.total) # # 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
10 11 12 13 |
# File 'app/presenters/search/order_text_presenter.rb', line 10 def spiff_rep_link return unless r.has_columns?(:spiff_rep_full_name, :spiff_rep_id) "#{r.spiff_rep_full_name}" end |
#total_revenue ⇒ Object
24 |
# File 'app/presenters/search/order_text_presenter.rb', line 24 def total_revenue = (r.total || 0.00) |