From: larssandergreen Date: Thu, 27 Apr 2023 16:37:41 +0000 (-0600) Subject: Set default payment method for addt payment or refund X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=63bd5be8b56fd0766824d05312ca0cac25a6de79;p=civicrm-core.git Set default payment method for addt payment or refund --- 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 @@ - +
{$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}