From 63bd5be8b56fd0766824d05312ca0cac25a6de79 Mon Sep 17 00:00:00 2001 From: larssandergreen Date: Thu, 27 Apr 2023 10:37:41 -0600 Subject: [PATCH] Set default payment method for addt payment or refund --- CRM/Contribute/Form/AdditionalPayment.php | 6 ++++++ templates/CRM/Contribute/Form/AdditionalPayment.tpl | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index 9736955044..5fe2d3ac33 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -161,6 +161,12 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract // Set $newCredit variable in template to control whether link to credit card mode is included $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()); + + $defaults['payment_instrument_id'] = \Civi\Api4\Contribution::get(FALSE) + ->addSelect('payment_instrument_id') + ->addWhere('id', '=', $this->_contributionId) + ->execute()->first()['payment_instrument_id']; + return $defaults; } diff --git a/templates/CRM/Contribute/Form/AdditionalPayment.tpl b/templates/CRM/Contribute/Form/AdditionalPayment.tpl index df7c946dba..0c10fe597a 100644 --- a/templates/CRM/Contribute/Form/AdditionalPayment.tpl +++ b/templates/CRM/Contribute/Form/AdditionalPayment.tpl @@ -84,9 +84,7 @@ - + -- 2.25.1
{$form.trxn_date.label}{$form.trxn_date.html}
- {ts}The date this payment was received.{/ts} -
{$form.trxn_date.html}
{$form.payment_instrument_id.label}