Class: Search::CreditMemoPresenter

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

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

#billing_customerObject



14
15
16
17
# File 'app/presenters/search/credit_memo_presenter.rb', line 14

def billing_customer
  return nil if r.billing_customer_id.nil?
  h.link_to(r.billing_customer_name, h.customer_path(r.billing_customer_id))
end

#coObject



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

def co
  return nil if r.credit_order_id.nil?
  h.link_to(r.credit_order_reference_number, h.order_path(r.credit_order_id))
end

#created_atObject



46
47
48
# File 'app/presenters/search/credit_memo_presenter.rb', line 46

def created_at
  h.render_date(r.created_at)
end

#credit_memoObject



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

def credit_memo
  h.link_to(r.reference_number, h.credit_memo_path(r.id))
end

#customerObject



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

def customer
  h.link_to(r.customer_name, h.customer_path(r.customer_id))
end

#document_dateObject



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

def document_date
  h.render_date(r.document_date)
end

#original_orderObject



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

def original_order
  return nil if r.original_order_id.nil?
  h.link_to(r.original_order_reference_number, h.order_path(r.original_order_id))
end

#request_dateObject



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

def request_date
  h.render_date(r.request_date)
end

#rmaObject



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

def rma
  return nil if r.rma_id.nil?
  h.link_to(r.rma_number, h.rma_path(r.rma_id))
end

#totalObject



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

def total
  h.number_to_currency(r.total, unit: Money::Currency.new(r.currency).symbol)
end