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
#generate_permalink, #save_permalink
Instance Method Details
#amount ⇒ Object
36
37
38
|
# File 'app/models/spree/return_authorization.rb', line 36
def amount
return_items.sum(:amount)
end
|
#can_cancel_return_items? ⇒ Boolean
52
53
54
|
# File 'app/models/spree/return_authorization.rb', line 52
def can_cancel_return_items?
return_items.any?(&:can_cancel?) || return_items.blank?
end
|
#currency ⇒ Object
40
41
42
|
# File 'app/models/spree/return_authorization.rb', line 40
def currency
order.currency
end
|
#customer_returned_items? ⇒ Boolean
48
49
50
|
# File 'app/models/spree/return_authorization.rb', line 48
def customer_returned_items?
customer_returns.exists?
end
|
#refundable_amount ⇒ Object
44
45
46
|
# File 'app/models/spree/return_authorization.rb', line 44
def refundable_amount
order.item_total_before_tax + order.promo_total
end
|
#total_excluding_vat ⇒ Object
32
33
34
|
# File 'app/models/spree/return_authorization.rb', line 32
def total_excluding_vat
return_items.sum(&:total_excluding_vat)
end
|