Class: Spree::ReturnAuthorization
- Inherits:
-
Base
- Object
- ActiveRecord::Base
- Base
- Spree::ReturnAuthorization
show all
- Extended by:
- DisplayMoney
- Defined in:
- app/models/spree/return_authorization.rb
Overview
Models the return of Inventory Units to a Stock Location for an Order.
Instance Method Summary
collapse
money_methods
Methods inherited from Base
display_includes, #initialize_preference_defaults, page, preference
#admin_form_preference_names, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference
Instance Method Details
#amount ⇒ Object
45
46
47
|
# File 'app/models/spree/return_authorization.rb', line 45
def amount
return_items.sum(:amount)
end
|
#can_cancel_return_items? ⇒ Boolean
61
62
63
|
# File 'app/models/spree/return_authorization.rb', line 61
def can_cancel_return_items?
return_items.any?(&:can_cancel?) || return_items.blank?
end
|
#currency ⇒ Object
49
50
51
|
# File 'app/models/spree/return_authorization.rb', line 49
def currency
order.currency
end
|
#customer_returned_items? ⇒ Boolean
57
58
59
|
# File 'app/models/spree/return_authorization.rb', line 57
def customer_returned_items?
customer_returns.exists?
end
|
#refundable_amount ⇒ Object
53
54
55
|
# File 'app/models/spree/return_authorization.rb', line 53
def refundable_amount
order.item_total_before_tax + order.promo_total
end
|
#total_excluding_vat ⇒ Object
Also known as:
pre_tax_total
39
40
41
|
# File 'app/models/spree/return_authorization.rb', line 39
def total_excluding_vat
return_items.map(&:total_excluding_vat).sum
end
|