Skip to content

Commit

Permalink
Merge pull request #18417 from eileenmcnaughton/pay_more
Browse files Browse the repository at this point in the history
dev/financial#86 Make 'Record Payment' & 'Record Refund' visible regardless of whether the balance 'requires' one
  • Loading branch information
seamuslee001 authored Sep 16, 2020
2 parents b392538 + 4cbe461 commit c76aec5
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -5230,35 +5230,27 @@ protected static function getContributionPaymentLinks($id, $balance, $contributi
'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;
}

Expand Down

0 comments on commit c76aec5

Please sign in to comment.