Class: Search::PurchaseOrderPresenter
- Inherits:
-
BasePresenter
- Object
- SimpleDelegator
- BasePresenter
- Search::PurchaseOrderPresenter
show all
- Includes:
- Presenters::Timeable
- Defined in:
- app/presenters/search/purchase_order_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
#items_report_link ⇒ Object
15
16
17
18
|
# File 'app/presenters/search/purchase_order_presenter.rb', line 15
def items_report_link
return unless r.has_columns?(:items_report)
h.render partial: '/purchase_orders/search_items_report', locals: { items_report: r.items_report, search_result: r }
end
|
#order_date ⇒ Object
34
35
36
|
# File 'app/presenters/search/purchase_order_presenter.rb', line 34
def order_date
h.render_date r.order_date
end
|
#promised_delivery_date ⇒ Object
30
31
32
|
# File 'app/presenters/search/purchase_order_presenter.rb', line 30
def promised_delivery_date
h.render_date r.promised_delivery_date
end
|
#purchase_order_link ⇒ Object
6
7
8
|
# File 'app/presenters/search/purchase_order_presenter.rb', line 6
def purchase_order_link
h.link_to r.reference_number, h.purchase_order_path(r.id)
end
|
#supplier_link ⇒ Object
10
11
12
13
|
# File 'app/presenters/search/purchase_order_presenter.rb', line 10
def supplier_link
return unless r.has_columns?(:supplier_full_name, :supplier_id) && h.can?(:read, Supplier)
h.link_to r.supplier_full_name, h.supplier_path(r.supplier_id)
end
|
#terms ⇒ Object
25
26
27
28
|
# File 'app/presenters/search/purchase_order_presenter.rb', line 25
def terms
return h.fa_icon('lock') unless h.can?(:manage_item_costs, r)
r.terms
end
|
#total_costs ⇒ Object
20
21
22
23
|
# File 'app/presenters/search/purchase_order_presenter.rb', line 20
def total_costs
return h.fa_icon('lock') unless h.can?(:manage_item_costs, r)
h.number_to_currency(r.total_cost || 0)
end
|