Class: Search::ReceiptPresenter
- Inherits:
-
BasePresenter
show all
- Includes:
- Presenters::Timeable
- Defined in:
- app/presenters/search/receipt_presenter.rb
Instance Attribute Summary
#current_account, #options, #url_helper
Instance Method Summary
collapse
#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
#amount ⇒ Object
28
29
30
|
# File 'app/presenters/search/receipt_presenter.rb', line 28
def amount
h.number_to_currency(r.amount, unit: currency_symbol)
end
|
#currency_symbol ⇒ Object
24
25
26
|
# File 'app/presenters/search/receipt_presenter.rb', line 24
def currency_symbol
Money::Currency.new('USD').symbol
end
|
#customer_link ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/presenters/search/receipt_presenter.rb', line 10
def customer_link
path = case r.customer_type
when 'Supplier'
h.supplier_path(r.customer_id)
when 'Employee'
h.employee_path(r.customer_id)
when 'Contact'
h.contact_path(r.customer_id)
when 'Customer'
h.customer_path(r.customer_id)
end
h.link_to(r.customer_name, path)
end
|
#gl_date ⇒ Object
36
37
38
|
# File 'app/presenters/search/receipt_presenter.rb', line 36
def gl_date
h.render_date(r.gl_date)
end
|
#receipt_date ⇒ Object
32
33
34
|
# File 'app/presenters/search/receipt_presenter.rb', line 32
def receipt_date
h.render_date(r.receipt_date)
end
|
#receipt_link ⇒ Object
6
7
8
|
# File 'app/presenters/search/receipt_presenter.rb', line 6
def receipt_link
h.link_to(r.id, h.receipt_path(r.id))
end
|