Sha256: 039010f50411e13bc7e1cf273c889e7cabc19184e248ca84fd6319532661f044

Contents?: true

Size: 539 Bytes

Versions: 17

Compression:

Stored size: 539 Bytes

Contents

module Spree
  module Tax
    # Add tax adjustments to all line items and shipments in an order
    class OrderAdjuster
      attr_reader :order

      # @param [Spree::Order] order to be adjusted
      def initialize(order)
        @order = order
      end

      # Creates tax adjustments for all taxable items (shipments and line items)
      # in the given order.
      def adjust!
        taxes = Spree::Config.tax_calculator_class.new(order).calculate
        Spree::OrderTaxation.new(order).apply(taxes)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
solidus_core-2.5.2 app/models/spree/tax/order_adjuster.rb
solidus_core-2.5.1 app/models/spree/tax/order_adjuster.rb
solidus_core-2.5.0 app/models/spree/tax/order_adjuster.rb
solidus_core-2.5.0.rc1 app/models/spree/tax/order_adjuster.rb
solidus_core-2.5.0.beta2 app/models/spree/tax/order_adjuster.rb
solidus_core-2.5.0.beta1 app/models/spree/tax/order_adjuster.rb
solidus_core-2.4.2 app/models/spree/tax/order_adjuster.rb
solidus_core-2.3.1 app/models/spree/tax/order_adjuster.rb
solidus_core-2.4.1 app/models/spree/tax/order_adjuster.rb
solidus_core-2.4.0 app/models/spree/tax/order_adjuster.rb
solidus_core-2.4.0.rc1 app/models/spree/tax/order_adjuster.rb
solidus_core-2.4.0.beta1 app/models/spree/tax/order_adjuster.rb
solidus_core-2.3.0 app/models/spree/tax/order_adjuster.rb
solidus_core-2.3.0.rc3 app/models/spree/tax/order_adjuster.rb
solidus_core-2.3.0.rc2 app/models/spree/tax/order_adjuster.rb
solidus_core-2.3.0.rc1 app/models/spree/tax/order_adjuster.rb
solidus_core-2.3.0.beta1 app/models/spree/tax/order_adjuster.rb