Class: Spree::ReturnAuthorization

Inherits:
Base
  • Object
show all
Extended by:
DisplayMoney
Defined in:
app/models/spree/return_authorization.rb

Instance Method Summary collapse

Methods included from DisplayMoney

money_methods

Methods inherited from Base

belongs_to_required_by_default, page, spree_base_scopes

Methods included from Preferences::Preferable

#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Instance Method Details

#can_cancel_return_items?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'app/models/spree/return_authorization.rb', line 58

def can_cancel_return_items?
  return_items.any?(&:can_cancel?) || return_items.blank?
end

#currencyObject



46
47
48
# File 'app/models/spree/return_authorization.rb', line 46

def currency
  order.nil? ? Spree::Config[:currency] : order.currency
end

#customer_returned_items?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'app/models/spree/return_authorization.rb', line 54

def customer_returned_items?
  customer_returns.exists?
end

#pre_tax_totalObject



42
43
44
# File 'app/models/spree/return_authorization.rb', line 42

def pre_tax_total
  return_items.sum(:pre_tax_amount)
end

#refundable_amountObject



50
51
52
# File 'app/models/spree/return_authorization.rb', line 50

def refundable_amount
  order.pre_tax_item_amount + order.promo_total
end