Method: Spree::TaxRate#compute_amount

Defined in:
app/models/spree/tax_rate.rb

#compute_amount(item) ⇒ Object

This method is used by Adjustment#update to recalculate the cost.



165
166
167
168
169
170
171
172
173
174
175
176
# File 'app/models/spree/tax_rate.rb', line 165

def compute_amount(item)
  if included_in_price
    if default_zone_or_zone_match?(item.order.tax_zone)
      calculator.compute(item)
    else
      # In this case, it's a refund.
      calculator.compute(item) * - 1
    end
  else
    calculator.compute(item)
  end
end