CRM-15203 - Recurring contributions don't create MembershipPayment records
authoratif-shaikh <shaikh388@gmail.com>
Tue, 6 Jan 2015 12:34:27 +0000 (18:04 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Tue, 6 Jan 2015 12:34:27 +0000 (18:04 +0530)
https://issues.civicrm.org/jira/browse/CRM-15203

CRM/Upgrade/Incremental/sql/4.6.alpha1.mysql.tpl

index b363d6de543ce62efb168551d61c792bfd717bb1..ac2901af34decfe793cdd0a3dd66a7b954e4c721 100755 (executable)
@@ -133,3 +133,6 @@ UPDATE `civicrm_state_province` SET `name`='Papua Barat', `abbreviation`='PB' WH
 UPDATE `civicrm_state_province` SET `name`='DKI Jakarta' WHERE `id` = 3083;
 UPDATE `civicrm_state_province` SET `name`='DI Yogyakarta' WHERE `id` = 3085;
 UPDATE `civicrm_state_province` SET `abbreviation`='KI' WHERE `id` = 3066;
+
+-- CRM-15203 Recurring contributions don't create MembershipPayment records
+INSERT INTO civicrm_membership_payment (contribution_id, membership_id) select cc.id, cm.id FROM civicrm_contribution cc LEFT JOIN civicrm_membership_payment cmp ON cc.id = cmp.contribution_id LEFT JOIN civicrm_membership cm ON cc.contribution_recur_id = cm.contribution_recur_id WHERE cc.contribution_recur_id IS NOT NULL AND cmp.id IS NULL AND cm.id IS NOT NULL;