Project60 / org.project60.sepa

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

Issues merging contacts with mandates? #719

Closed francescbassas closed 3 months ago

francescbassas commented 5 months ago

I have discovered a strange behaviour. A mandate in a trashed contact. Inspecting the contact I could see that it has been combined with another. I consider two possibilities(I bet on the second one): (1) Mandates are ignored in the merge contacts UI? (2) If the user doesn't have permissions on CiviSEPA mandates are hidden from the UI and therefore always remain in the deleted contact.

bjendres commented 5 months ago

Thanks for noting @francescbassas!

A couple of points:

  1. A mandate will be deleted when a contact is deleted.
  2. Mandates should be merged when a contact is merged (see HERE).
  3. I don't think there's any rules for contacts in trash, i.e. is_deleted=1. So if you put a contact in trash, I think an affiliated mandate might still be collected.

What would you expect to happen with those? I think I'd rather collect too much than too little from a donor.

In any case, if we want to change the current behaviour, we should add a configuration option to explicitly activate it.

francescbassas commented 5 months ago

Thanks @bjendres.

I would expect that no mandate could be left in the trash. How about the contributions. You cannot delete a contact without first deleting their contributions.

However, I found a case in which it did happen and upon checking it seemed to me that it was a permission issue in the contact combination. I will keep an eye out to see if it happens again and if any further testing is needed.

bjendres commented 3 months ago

Feel free to re-open if you want this ticket to stick around.