Class: Spree::ReturnAuthorization

Inherits:
Object
  • Object
show all
Extended by:
DisplayMoney
Includes:
NumberIdentifier, Webhooks::HasWebhooks
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)


66
67
68
# File 'app/models/spree/return_authorization.rb', line 66

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

#currencyObject



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

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)


62
63
64
# File 'app/models/spree/return_authorization.rb', line 62

def customer_returned_items?
  customer_returns.exists?
end

#pre_tax_totalObject



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

def pre_tax_total
  return_items.sum(:pre_tax_amount)
end

#refundable_amountObject



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

def refundable_amount
  order.pre_tax_item_amount + order.promo_total
end