The new financial types Recurring Gift and Recurring Gift - Cash are working.
However, I'm finding some recurring gifts that are being coded as Recurring Gift when they are actually not the first gift in a donor's recurring gift series. CID 5822008
The new financial types Recurring Gift and Recurring Gift - Cash are working.
However, I'm finding some recurring gifts that are being coded as Recurring Gift when they are actually not the first gift in a donor's recurring gift series. CID 5822008
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Fix recurring contributions being given wrong type on subsequent | wikimedia/fundraising/crm | master | +99 -28 |
Change 963428 had a related patch set uploaded (by Eileen; author: Eileen):
[wikimedia/fundraising/crm@master] Add unit test check to trace wrong types on recurring contributions
Change 963428 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Fix recurring contributions being given wrong type on subsequent
Just noting that these 2 queries should run 'clean' (return 0 results)
SELECT count(*) FROM civicrm_contribution a -- join to previous contributions with the same contribution recur id which happened before the given one LEFT JOIN civicrm_contribution c2 ON c2.contribution_recur_id = a.contribution_recur_id AND c2.receive_date < a.receive_date LEFT JOIN `civicrm_value_1_gift_data_7` Gift_Data ON a.id = Gift_Data.entity_id WHERE `a`.`receive_date` > "20230701000000" AND `a`.`contribution_recur_id` > 0 -- financial type not already of recurring type AND `a`.`financial_type_id` NOT IN (31) AND `a`.`is_test` = 0 AND c2.id IS NULL LIMIT 5000; SELECT count(*) FROM civicrm_contribution a -- join to previous contributions with the same contribution recur id which happened before the given one LEFT JOIN civicrm_contribution c2 ON c2.contribution_recur_id = a.contribution_recur_id AND c2.receive_date < a.receive_date LEFT JOIN `civicrm_value_1_gift_data_7` Gift_Data ON a.id = Gift_Data.entity_id WHERE `a`.`receive_date` > "20230701000000" AND `a`.`contribution_recur_id` > 0 -- financial type not already of recurring type AND `a`.`financial_type_id` NOT IN (32) AND `a`.`is_test` = 0 AND c2.id IS NOT NULL LIMIT 5000;
This query is not running clean
SELECT count(*) FROM civicrm_contribution a -- join to previous contributions with the same contribution recur id which happened before the given one LEFT JOIN civicrm_contribution c2 ON c2.contribution_recur_id = a.contribution_recur_id AND c2.receive_date < a.receive_date LEFT JOIN `civicrm_value_1_gift_data_7` Gift_Data ON a.id = Gift_Data.entity_id WHERE `a`.`receive_date` > "20230701000000" AND `a`.`contribution_recur_id` > 0 -- financial type not already of recurring type AND `a`.`financial_type_id` NOT IN (31) AND `a`.`is_test` = 0 AND c2.id IS NULL LIMIT 5000;
Because we appear to still be creating new adyen with the incorrect financial type (ie first in series has 'Recurring Gift Cash' not 'Recurring Gift'
So it seems that with a contact like
https://civicrm.wikimedia.org/civicrm/contact/view?reset=1&cid=2560914&selectedChild=contribute the $104 record is the first , kinda, but the the $25 is the first one that is attached to the recurring. I have put up a patch that gives the second one the financial type to denote it as the first
I'm not 100% clear on the whole flow
Pushed up a patch to run the upgrade once more as 1550 still to do (seems like no new ones have happened since 26 Oct so hopefully this will be the end of it)