Skip to content

Commit

Permalink
CIWEM-113: Use the correct "to account" when recording a payment
Browse files Browse the repository at this point in the history
Included in: civicrm#27975
  • Loading branch information
omarabuhussein committed Nov 10, 2023
1 parent 302bf69 commit a0305ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,12 @@ public static function getToFinancialAccount($contribution, $params) {
if (!empty($params['payment_processor_id'])) {
return CRM_Contribute_PseudoConstant::getRelationalFinancialAccount($params['payment_processor_id'], NULL, 'civicrm_payment_processor');
}

if (!empty($params['payment_instrument_id'])) {
return CRM_Financial_BAO_FinancialTypeAccount::getInstrumentFinancialAccount($params['payment_instrument_id']);
}

if (!empty($contribution['payment_instrument_id'])) {
return CRM_Financial_BAO_FinancialTypeAccount::getInstrumentFinancialAccount($contribution['payment_instrument_id']);
}
else {
Expand Down

0 comments on commit a0305ce

Please sign in to comment.