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?, #description, description, #to_s

Methods inherited from Base

display_includes

Methods included from Spree::Core::Permalinks

#generate_permalink, #save_permalink

Instance Method Details

#compute(return_item) ⇒ Object



9
10
11
12
# File '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