From 4cbe461a4d4c66220fd91c5609945ac042c9fcfa Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 9 Sep 2020 18:15:18 +1200 Subject: [PATCH] dev/financial#86 Make 'Record Payment' & 'Record Refund' visible regardless of whether the balance 'requires' one This was agreed about a year ago - might as well do it --- CRM/Contribute/BAO/Contribution.php | 34 +++++++++++------------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 3de7326172..018e99b27a 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -5201,35 +5201,27 @@ LIMIT 1;"; 'title' => ts('Record Payment'), ]; - if ((int) $balance > 0) { - // @todo - this should be possible even if not > 0 - test & remove this if. - // it is possible to 'overpay' in the real world & we honor that. - if (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) { - $actionLinks[] = [ - 'url' => CRM_Utils_System::url('civicrm/payment', [ - 'action' => 'add', - 'reset' => 1, - 'is_refund' => 0, - 'id' => $id, - 'mode' => 'live', - ]), - 'title' => ts('Submit Credit Card payment'), - ]; - } - } - elseif ((int) $balance < 0) { - // @todo - in the future remove this IF - OK to refund money even when not due since - // ... life. + if (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) { $actionLinks[] = [ 'url' => CRM_Utils_System::url('civicrm/payment', [ 'action' => 'add', 'reset' => 1, + 'is_refund' => 0, 'id' => $id, - 'is_refund' => 1, + 'mode' => 'live', ]), - 'title' => ts('Record Refund'), + 'title' => ts('Submit Credit Card payment'), ]; } + $actionLinks[] = [ + 'url' => CRM_Utils_System::url('civicrm/payment', [ + 'action' => 'add', + 'reset' => 1, + 'id' => $id, + 'is_refund' => 1, + ]), + 'title' => ts('Record Refund'), + ]; return $actionLinks; } -- 2.25.1