Class: Spree::ReturnAuthorization

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

Instance Method Summary collapse

Methods inherited from Base

page

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

#currencyObject


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

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

#customer_returned_items?Boolean

Returns:

  • (Boolean)

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

def customer_returned_items?
  customer_returns.exists?
end

#display_pre_tax_totalObject


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

def display_pre_tax_total
  Spree::Money.new(pre_tax_total, { currency: currency })
end

#pre_tax_totalObject


37
38
39
# File 'app/models/spree/return_authorization.rb', line 37

def pre_tax_total
  return_items.sum(:pre_tax_amount)
end

#refundable_amountObject


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

def refundable_amount
  order.pre_tax_item_amount + order.promo_total
end