From 7882c427f7e9e43ea564a40447a0ed4675f10d82 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 24 Mar 2021 15:20:57 +0000 Subject: [PATCH] Simplify creation of negative amounts --- app/models/spree/return_authorization.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/spree/return_authorization.rb b/app/models/spree/return_authorization.rb index 20dab21122..f05afee8c4 100644 --- a/app/models/spree/return_authorization.rb +++ b/app/models/spree/return_authorization.rb @@ -66,7 +66,7 @@ module Spree # Used when Adjustment#update! wants to update the related adjustment def compute_amount(*_args) - amount.abs * -1 + -amount.abs end private @@ -95,7 +95,7 @@ module Spree end Adjustment.create( - amount: amount.abs * -1, + amount: -amount.abs, label: I18n.t('spree.rma_credit'), order: order, adjustable: order,