Project60 / org.project60.banking

CiviCRM banking extension
18 stars 35 forks source link

Dedupe Function: Duplicate References not clear and not able to process 'Fix' #367

Closed BettyDolfing closed 1 year ago

BettyDolfing commented 2 years ago

For a client of CiviCooP that uses CiviBanking a lot (thanks!) I have a question about the Dedupe functionality.

When you go to CiviBanking - Dedupe Accounts, you will get a overview with 3 different types of issues:

A. Duplicate References B. Duplicate Bank Accounts C. Bank Account Ownership Conflicts

For B and C I am clear in what they do. My question is about A:

See attachment screenshot-civicrm dedupe bank acount-2022 07 20-19_44_50

Hopefully you can help me answering the above.

bjendres commented 2 years ago

Hi @BettyDolfing.

what is the context of Duplicate References?

For the "Duplicate References" you have to understand, that a CiviBanking bank account object itself doesn't have an account number. Those are separate entities, so that a bank account could, for example, have an IBAN reference, and an (old) Dutch national bank account number.

when I click on Fix (whatever it is it is fixing) the contact information/bank account number remains in the list and there is a message: 'Successful! 0 duplicate references successfully deleted.'

That seems to be a bug. Could you post the contents of civicrm_bank_account and civicrm_bank_account_reference for your case?

BettyDolfing commented 2 years ago

@bjendres Thanks for the answer/explanation. Jaap has now cleaned it up in the database.

As for adding banking info: we can not because of GDPR reasons. For us, this issue is no longer an issue. Thanks again for your help.

bjendres commented 2 years ago

@jaapjansma has now cleaned it up in the database.

Could you maybe post what you did, so other people finding this ticket could do the same?

Thanks again for your help.

Happy to help.

jaapjansma commented 2 years ago

DELETE FROM `civicrm_bank_account_reference` WHERE `ba_id` IS NULL
jaapjansma commented 1 year ago

Also the following query does some clean up of bank accounts which are not linked to a contact:


DELETE
    `civicrm_bank_account_reference`,
    `civicrm_bank_account`
FROM
    `civicrm_bank_account_reference`
LEFT JOIN `civicrm_bank_account` ON
    `ba_id` = `civicrm_bank_account`.`id`
WHERE
      `contact_id` IS NULL
jaapjansma commented 1 year ago

A fix for the dedupe screen is proposed in PR #374