From: Edsel Date: Mon, 13 Jul 2015 11:30:53 +0000 (+0530) Subject: CRM-16835 Added fix to allow contributions with Partially paid status to be Completed X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=827e15a47715e367c2915054fb1cf7afea18e736;p=civicrm-core.git CRM-16835 Added fix to allow contributions with Partially paid status to be Completed ---------------------------------------- * CRM-16835: Support changing contributions with partially paid status to completed. https://issues.civicrm.org/jira/browse/CRM-16835 --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 534b387ced..28973aec7f 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3043,6 +3043,12 @@ WHERE contribution_id = %1 "; ) { return; } + if (($params['prevContribution']->contribution_status_id == array_search('Partially paid', $contributionStatus)) + && $params['contribution']->contribution_status_id == array_search('Completed', $contributionStatus) + && $context == 'changedStatus' + ) { + return; + } if ($context == 'changedAmount' || $context == 'changeFinancialType') { $itemAmount = $params['trxnParams']['total_amount'] = $params['total_amount'] - $params['prevContribution']->total_amount; } @@ -3228,6 +3234,7 @@ WHERE contribution_id = %1 "; 'Pending' => array('Cancelled', 'Completed', 'Failed'), 'In Progress' => array('Cancelled', 'Completed', 'Failed'), 'Refunded' => array('Cancelled', 'Completed'), + 'Partially paid' => array('Completed'), ); if (!in_array($contributionStatuses[$fields['contribution_status_id']], $checkStatus[$contributionStatuses[$values['contribution_status_id']]])) {