Class: Spree::ReturnAuthorization

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

Instance Method Summary collapse

Methods included from DisplayMoney

money_methods

Instance Method Details

#can_cancel_return_items?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'app/models/spree/return_authorization.rb', line 68

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

#currencyObject



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

def currency
  # FIXME: we should associate ReturnAuthorization with Store
  order.nil? ? Spree::Store.default.default_currency : order.currency
end

#customer_returned_items?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'app/models/spree/return_authorization.rb', line 64

def customer_returned_items?
  customer_returns.exists?
end

#pre_tax_totalObject



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

def pre_tax_total
  return_items.sum(:pre_tax_amount)
end

#refundable_amountObject



60
61
62
# File 'app/models/spree/return_authorization.rb', line 60

def refundable_amount
  order.pre_tax_item_amount + order.promo_total
end