Class: Spree::Calculator::Returns::DefaultRefundAmount

Inherits:
ReturnsCalculator show all
Defined in:
app/models/spree/calculator/returns/default_refund_amount.rb

Instance Method Summary collapse

Methods inherited from Spree::Calculator

#available?, calculators, description, #description, register, #to_s

Methods inherited from Base

display_includes, #initialize_preference_defaults, page, preference

Methods included from Preferences::Preferable

#default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Instance Method Details

#compute(return_item) ⇒ Object



7
8
9
10
# File 'app/models/spree/calculator/returns/default_refund_amount.rb', line 7

def compute(return_item)
  return 0.0.to_d if return_item.part_of_exchange?
  weighted_order_adjustment_amount(return_item.inventory_unit) + weighted_line_item_amount(return_item.inventory_unit)
end