Skip to content

Commit

Permalink
fixing #514
Browse files Browse the repository at this point in the history
  • Loading branch information
bjendres committed Oct 31, 2018
1 parent ade3a31 commit 0422674
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CRM/Sepa/Logic/Queue/Close.php
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,14 @@ protected function updateContributionStatus($contributions) {
// this status cannot be set via the API -> use SQL
CRM_Core_DAO::executeQuery("UPDATE civicrm_contribution SET contribution_status_id={$status_inProgress} WHERE id IN ({$contribution_id_list});");

} else {
// this should be status 'Completed', but it doesn't really matter
} else { // this should be status 'Completed', but it doesn't really matter
// first, some sanity checks:
if (version_compare(CRM_Utils_System::version(), '4.7.0', '>=')) {
// make sure they're all in status 'In Progress' to avoid SEPA-514
CRM_Core_DAO::executeQuery("UPDATE civicrm_contribution SET contribution_status_id={$status_inProgress} WHERE id IN ({$contribution_id_list});");
}

// then: set them all to the new status
foreach ($contributions as $contribution) {
civicrm_api3('Contribution', 'create', array(
'id' => $contribution['id'],
Expand Down

0 comments on commit 0422674

Please sign in to comment.