Use OrderTaxAdjustmentsFetcher service

This commit is contained in:
François Turbelin
2020-06-09 11:03:11 +02:00
parent c729f64fcf
commit 9abe41f6cb
7 changed files with 102 additions and 86 deletions

View File

@@ -44,7 +44,7 @@ module CheckoutHelper
end
def display_checkout_taxes_hash(order)
order.tax_adjustment_totals.each_with_object({}) do |(tax_rate, tax_amount), hash|
OrderTaxAdjustmentsFetcher.new(order).totals.each_with_object({}) do |(tax_rate, tax_amount), hash|
hash[number_to_percentage(tax_rate.amount * 100, precision: 1)] = Spree::Money.new tax_amount, currency: order.currency
end
end