From 937cede9b8c2f84afbf353d85fec2be5b52d2cab Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 10 Jun 2021 17:16:45 +0100 Subject: [PATCH] Fix tax adjustment label :amount is actually a property on the TaxRate object itself that refers to the rate (eg 10% expressed as 0.10), and is not the same as the adjustment amount being passed in to this method (eg: $4.28) --- app/models/spree/tax_rate.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/spree/tax_rate.rb b/app/models/spree/tax_rate.rb index bd00dbd9cc..369aabb3bf 100644 --- a/app/models/spree/tax_rate.rb +++ b/app/models/spree/tax_rate.rb @@ -138,9 +138,9 @@ module Spree private - def create_label(amount) + def create_label(adjustment_amount) label = "" - label << "#{Spree.t(:refund)} " if amount.negative? + label << "#{Spree.t(:refund)} " if adjustment_amount.negative? label << "#{(name.presence || tax_category.name)} " label << (show_rate_in_label? ? "#{amount * 100}%" : "") label << " (#{I18n.t('models.tax_rate.included_in_price')})" if included_in_price?