From 6ed35f4cc1034a6feada1253c384b1435f688d5d Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Fri, 4 Aug 2023 17:03:31 +1000 Subject: [PATCH] Per review, delete only incomplete payments Use destroy_all so we don't have to manually delete the payment fees adjustment --- app/controllers/voucher_adjustments_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/voucher_adjustments_controller.rb b/app/controllers/voucher_adjustments_controller.rb index 152097f68c..094ef26cf7 100644 --- a/app/controllers/voucher_adjustments_controller.rb +++ b/app/controllers/voucher_adjustments_controller.rb @@ -82,7 +82,6 @@ class VoucherAdjustmentsController < BaseController # Clear payments and payment fees, to not affect voucher adjustment calculation def clear_payments - @order.all_adjustments.payment_fee.destroy_all - @order.payments.clear + @order.payments.incomplete.destroy_all end end