Project60 / org.project60.sepa

SEPA direct debit integration with civicrm
19 stars 46 forks source link

Closing transaction groups changes ContributionRecur status #514

Open bjendres opened 5 years ago

bjendres commented 5 years ago

Recurring mandates consist of the SepaMandate entity, linked to a ContributionRecur entity. It is important, that this ContributionRecur maintains the status Pending while the mandate is active.

Apparently, CiviCRM core has (secretly?) changed it's behaviour with 4.7, and now automatically sets the a ContributionRecur's status to In Progress whenever a linked contribution is set from Pending to Completed . This happens when a group is closed, because since the status change In Progress to Completed wasn't possible in the past, it first sets it back to Pending.

When you're affected by this but, it would show as "left behind" SEPA contributions of status In Progress. In the worst case, you would still collect money after the cancelling the mandate, if the contribution was already created at the cancel time.

The reason is, that CiviCRM creates new contributions with the same status as the recurring contribution, and that should be Pending. The status In Progress, however, is considered to be "at the bank", so the algorithm won't touch it any more. That's why these falsely In Progress contributions will stick around, although that should've been deleted.

We wanted to change this behaviour, see #416, but it requires some work.

bjendres commented 5 years ago

Released with 1.4.alpha4