Merge match and its alias method

This commit is contained in:
Luis Ramos
2020-03-03 09:29:02 +00:00
parent a508c55700
commit 6c8b175344

View File

@@ -2,18 +2,13 @@ module Spree
TaxRate.class_eval do
class << self
def match(order)
return [] if order.distributor && !order.distributor.charges_sales_tax
return [] unless order.tax_zone
all.select do |rate|
rate.zone == order.tax_zone || rate.zone.contains?(order.tax_zone) || rate.zone.default_tax
end
end
def match_with_sales_tax_registration(order)
return [] if order.distributor && !order.distributor.charges_sales_tax
match_without_sales_tax_registration(order)
end
alias_method_chain :match, :sales_tax_registration
end
def adjust_with_included_tax(order)