Class: Search::RmaPresenter

Inherits:
BasePresenter show all
Includes:
Presenters::Timeable
Defined in:
app/presenters/search/rma_presenter.rb

Direct Known Subclasses

RmaTextPresenter

Instance Attribute Summary

Attributes inherited from BasePresenter

#current_account, #options, #url_helper

Instance Method Summary collapse

Methods inherited from BasePresenter

#can?, #capture, #concat, #content_tag, #fa_icon, #h, #initialize, #link_to, #number_to_currency, #present, presents, #r, #safe_present, #simple_format, #u

Constructor Details

This class inherits a constructor from BasePresenter

Instance Method Details

#actual_rma_creditObject



37
38
39
# File 'app/presenters/search/rma_presenter.rb', line 37

def actual_rma_credit
  h.number_to_currency(r.actual_rma_credit)
end

#created_atObject



29
30
31
# File 'app/presenters/search/rma_presenter.rb', line 29

def created_at
  h.render_date(r.created_at)
end

#customerObject



10
11
12
13
# File 'app/presenters/search/rma_presenter.rb', line 10

def customer
  return unless r.has_columns?(:customer_full_name, :customer_id)
  h.link_to r.customer_full_name, h.customer_path(r.customer_id)
end

#estimated_rma_creditObject



33
34
35
# File 'app/presenters/search/rma_presenter.rb', line 33

def estimated_rma_credit
  h.number_to_currency(r.estimated_rma_credit)
end

#invoiceObject



20
21
22
23
# File 'app/presenters/search/rma_presenter.rb', line 20

def invoice
  return unless r.has_columns?(:original_invoice_reference_number, :original_invoice_id)
  h.link_to r.original_invoice_reference_number, h.invoice_path(r.original_invoice_id)
end

#orderObject



15
16
17
18
# File 'app/presenters/search/rma_presenter.rb', line 15

def order
  return unless r.has_columns?(:original_order_reference_number, :original_order_id)
  h.link_to r.original_order_reference_number, h.order_path(r.original_order_id)
end

#returned_reasonsObject



25
26
27
# File 'app/presenters/search/rma_presenter.rb', line 25

def returned_reasons
  h.rma_returned_reasons_with_explanations(r.returned_reasons)
end

#rmaObject



6
7
8
# File 'app/presenters/search/rma_presenter.rb', line 6

def rma
  h.link_to r.rma_number, h.rma_path(r)
end