Module: Spree::Admin::StockMovementsHelper

Defined in:
app/helpers/spree/admin/stock_movements_helper.rb

Instance Method Summary collapse

Instance Method Details

#display_variant(stock_movement) ⇒ Object



22
23
24
25
26
27
# File 'app/helpers/spree/admin/stock_movements_helper.rb', line 22

def display_variant(stock_movement)
  variant = stock_movement.stock_item.variant
  output = [variant.name]
  output << variant.options_text unless variant.options_text.blank?
  safe_join(output, "<br>".html_safe)
end

#pretty_originator(stock_movement) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/spree/admin/stock_movements_helper.rb', line 6

def pretty_originator(stock_movement)
  originator = stock_movement.originator

  if originator.respond_to?(:number)
    if originator.respond_to?(:order)
      link_to originator.number, [:edit, :admin, originator.order]
    else
      originator.number
    end
  elsif originator.respond_to?(:email)
    originator.email
  else
    ""
  end
end