Class: Search::PurchaseOrderTextPresenter

Inherits:
PurchaseOrderPresenter
  • Object
show all
Defined in:
app/presenters/search/purchase_order_text_presenter.rb

Overview

Text-only row presenter for PurchaseOrderSearch — renders the same cells as
PurchaseOrderPresenter but without HTML links, for CSV/Excel export
or other plain-text consumers.

Instance Method Summary collapse

Instance Method Details

Purchase order reference number.

Returns:

  • (String)


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

def purchase_order_link
  r.reference_number
end

Supplier name; nil when the user lacks read permission or the required
columns are not selected.

Returns:

  • (String, nil)


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

def supplier_link
  return unless r.has_columns?(:supplier_full_name, :supplier_id) && h.can?(:read, Supplier)

  r.supplier_full_name
end