Remove included tax check from CalculatedAdjustments

This is handled in TaxRate now.
This commit is contained in:
Matt-Yorkley
2021-03-06 16:01:05 +00:00
parent ff9ad96b74
commit 8c9733d8da

View File

@@ -36,8 +36,7 @@ module Spree
order: order_object_for(adjustable),
label: label,
mandatory: mandatory,
state: state,
included: tax_included?(self, adjustable)
state: state
}
if adjustable.respond_to?(:adjustments)
@@ -65,15 +64,6 @@ module Spree
private
# Used for setting the #included boolean on tax adjustments. This will be removed in a
# later step, as the responsibility for creating all adjustments related to tax will be
# moved into the Spree::TaxRate class.
def tax_included?(originator, target)
originator.is_a?(Spree::TaxRate) &&
originator.included_in_price &&
originator.default_zone_or_zone_match?(order_object_for(target))
end
def order_object_for(target)
# Temporary method for adjustments transition.
if target.is_a? Spree::Order