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

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

Instance Method Summary collapse

Methods inherited from Spree::Calculator

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

Methods inherited from Base

display_includes, #initialize_preference_defaults, page, preference

Instance Method Details

#compute(return_item) ⇒ Object



9
10
11
12
# File 'core/app/models/spree/calculator/returns/default_refund_amount.rb', line 9

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