Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Officialize new taxation system #3354

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions core/app/models/spree/tax_calculator/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ module TaxCalculator
# The class used for tax calculation is configurable, so that the
# calculation can easily be pushed to third-party services. Users looking
# to provide their own calculator should adhere to the API of this class.
#
# @api experimental
# @note This API is currently in development and likely to change.
# Specifically, the input format is not yet finalized.
class Default
include Spree::Tax::TaxHelpers

Expand Down
3 changes: 0 additions & 3 deletions core/app/models/spree/tax_calculator/shipping_rate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ module TaxCalculator
# class.
#
# @see Spree::Tax::ShippingRateTaxer
# @api experimental
# @note This API is currently in development and likely to change.
# Specifically, the input format is not yet finalized.
class ShippingRate
include Spree::Tax::TaxHelpers

Expand Down
4 changes: 4 additions & 0 deletions core/app/models/spree/tax_rate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ class TaxRate < Spree::Base
scope :included_in_price, -> { where(included_in_price: true) }

# Creates necessary tax adjustments for the order.
#
# @deprecated Please use `Spree::Tax::OrderAdjuster#adjust!` instead
def adjust(_order_tax_zone, item)
Spree::Deprecation.warn("`Spree::TaxRate#adjust` is deprecated. Please use `Spree::Tax::OrderAdjuster#adjust!` instead.", caller)

amount = compute_amount(item)

item.adjustments.create!(
Expand Down
3 changes: 0 additions & 3 deletions core/lib/spree/app_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ def default_pricing_options
# @!attribute [rw] shipping_rate_tax_calculator_class
# @return [Class] a class with the same public interfaces as
# Spree::TaxCalculator::ShippingRate
# @api experimental
class_name_attribute :shipping_rate_tax_calculator_class, default: 'Spree::TaxCalculator::ShippingRate'

# Allows providing your own Mailer for order mailer.
Expand Down Expand Up @@ -384,15 +383,13 @@ def payment_canceller
# @!attribute [rw] tax_adjuster_class
# @return [Class] a class with the same public interfaces as
# Spree::Tax::OrderAdjuster
# @api experimental
class_name_attribute :tax_adjuster_class, default: 'Spree::Tax::OrderAdjuster'

# Allows providing your own class for calculating taxes on an order.
#
# @!attribute [rw] tax_calculator_class
# @return [Class] a class with the same public interfaces as
# Spree::TaxCalculator::Default
# @api experimental
class_name_attribute :tax_calculator_class, default: 'Spree::TaxCalculator::Default'

# Allows providing your own class for choosing which store to use.
Expand Down
1 change: 1 addition & 0 deletions core/spec/models/spree/tax_rate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@

describe 'adjustments' do
before do
expect(Spree::Deprecation).to receive(:warn)
tax_rate.adjust(nil, item)
end

Expand Down