Class: Search::OrderTextPresenter

Inherits:
OrderPresenter
  • Object
show all
Defined in:
app/presenters/search/order_text_presenter.rb

Instance Method Summary collapse

Instance Method Details



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


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_costObject



28
# File 'app/presenters/search/order_text_presenter.rb', line 28

def estimated_cost = r.estimated_cost

#gross_revenueObject



22
# File 'app/presenters/search/order_text_presenter.rb', line 22

def gross_revenue = (r.line_total || 0.00)

#msrpObject



26
# File 'app/presenters/search/order_text_presenter.rb', line 26

def msrp = (r.line_total_msrp || 0.00)

#notes_indicatorObject



20
# File 'app/presenters/search/order_text_presenter.rb', line 20

def notes_indicator = h.text_only(r.notes)


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_checkoutObject

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


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_revenueObject



24
# File 'app/presenters/search/order_text_presenter.rb', line 24

def total_revenue = (r.total || 0.00)