Class: Search::RmaPresenter

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

Overview

Presenter: rma presenter.

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



42
43
44
# File 'app/presenters/search/rma_presenter.rb', line 42

def actual_rma_credit
  h.number_to_currency(r.actual_rma_credit)
end

#created_atObject



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

def created_at
  h.render_date(r.created_at)
end

#customerObject



12
13
14
15
16
# File 'app/presenters/search/rma_presenter.rb', line 12

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



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

def estimated_rma_credit
  h.number_to_currency(r.estimated_rma_credit)
end

#invoiceObject



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

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



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

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



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

def returned_reasons
  h.rma_returned_reasons_with_explanations(r.returned_reasons)
end

#rmaObject



8
9
10
# File 'app/presenters/search/rma_presenter.rb', line 8

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