Class: Workarea::Pricing::Calculators::TaxCalculator

Inherits:
Object
  • Object
show all
Includes:
Workarea::Pricing::Calculator
Defined in:
app/models/workarea/pricing/calculators/tax_calculator.rb

Instance Method Summary collapse

Methods included from Workarea::Pricing::Calculator

#initialize

Instance Method Details

#adjustObject



7
8
9
10
11
12
13
14
# File 'app/models/workarea/pricing/calculators/tax_calculator.rb', line 7

def adjust
  shippings.each do |tmp_shipping|
    next unless tmp_shipping.address.present?

    adjustments_to_tax = price_adjustments_for(tmp_shipping)
    TaxApplier.new(tmp_shipping, adjustments_to_tax).apply
  end
end

#price_adjustments_for(shipping) ⇒ PriceAdjustmentSet

If doing split shipping (different items go to different shipping addresses), decorate this method to return the proper price adjustments that match the shipping. (This will have to be added to the UI and saved, probably on the Shipping object)

Returns:



23
24
25
# File 'app/models/workarea/pricing/calculators/tax_calculator.rb', line 23

def price_adjustments_for(shipping)
  order.price_adjustments
end