Sha256: 54f00bb51749791f7c33582d7089f8bcfee6123ccba3fcfbcb3decfbd4f343fb

Contents?: true

Size: 852 Bytes

Versions: 34

Compression:

Stored size: 852 Bytes

Contents

module Workarea
  module Pricing
    module Calculators
      class TaxCalculator
        include Calculator

        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

        # 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)
        #
        # @return [PriceAdjustmentSet]
        #
        def price_adjustments_for(shipping)
          order.price_adjustments
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.45 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.44 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.43 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.42 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.41 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.40 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.39 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.38 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.37 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.36 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.35 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.34 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.33 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.32 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.31 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.30 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.29 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.28 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.27 app/models/workarea/pricing/calculators/tax_calculator.rb
workarea-core-3.4.26 app/models/workarea/pricing/calculators/tax_calculator.rb