From 3fad2c65a5d7aebaa5c6478f695901727f96a795 Mon Sep 17 00:00:00 2001 From: Luciano Spiegel Date: Tue, 29 Jan 2019 18:10:18 +0100 Subject: [PATCH] remove duplicate call to createCreditNoteId() --- CRM/Contribute/BAO/Contribution.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 21d40d568a..2567ede134 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -495,19 +495,6 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution { } } - //if contribution is created with cancelled or refunded status, add credit note id - if (!empty($params['contribution_status_id'])) { - $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); - - if (($params['contribution_status_id'] == array_search('Refunded', $contributionStatus) - || $params['contribution_status_id'] == array_search('Cancelled', $contributionStatus)) - ) { - if (empty($params['creditnote_id']) || $params['creditnote_id'] == "null") { - $params['creditnote_id'] = self::createCreditNoteId(); - } - } - } - $transaction = new CRM_Core_Transaction(); try { -- 2.25.1