Class: Spree::ReturnAuthorization
Instance Method Summary
collapse
money_methods
Methods inherited from Base
belongs_to_required_by_default, for_store, has_many_inversing, json_api_columns, json_api_permitted_attributes, json_api_type, page, spree_base_scopes, spree_base_uniqueness_scope
#clear_preferences, #default_preferences, #defined_preferences, #deprecated_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_deprecated, #preference_type, #set_preference
Instance Method Details
#can_cancel_return_items? ⇒ Boolean
63
64
65
|
# File 'app/models/spree/return_authorization.rb', line 63
def can_cancel_return_items?
return_items.any?(&:can_cancel?) || return_items.blank?
end
|
#currency ⇒ Object
50
51
52
53
|
# File 'app/models/spree/return_authorization.rb', line 50
def currency
order.nil? ? Spree::Store.default.default_currency : order.currency
end
|
#customer_returned_items? ⇒ Boolean
59
60
61
|
# File 'app/models/spree/return_authorization.rb', line 59
def customer_returned_items?
customer_returns.exists?
end
|
#pre_tax_total ⇒ Object
46
47
48
|
# File 'app/models/spree/return_authorization.rb', line 46
def pre_tax_total
return_items.sum(:pre_tax_amount)
end
|
#refundable_amount ⇒ Object
55
56
57
|
# File 'app/models/spree/return_authorization.rb', line 55
def refundable_amount
order.pre_tax_item_amount + order.promo_total
end
|