mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge match and its alias method
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user