Bring TaxRate.match to OFN

The version of this method in spree 2.1 will break our build

This way we simply bypass this fix in spree: https://github.com/spree/spree/pull/3669

We can get back to this in the future if we ever experience the mentioned bug
This commit is contained in:
Luis Ramos
2020-03-03 09:27:04 +00:00
parent c37218fdc5
commit a508c55700
2 changed files with 9 additions and 0 deletions

View File

@@ -1,6 +1,13 @@
module Spree
TaxRate.class_eval do
class << self
def match(order)
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

View File

@@ -1,3 +1,5 @@
require 'spec_helper'
module Spree
describe TaxRate do
describe "selecting tax rates to apply to an order" do