CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Importing Membership and Contributions Together
Pages: [1]

Author Topic: Importing Membership and Contributions Together  (Read 1633 times)

funkyblue

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 0
  • CiviCRM version: 4.4.2
  • CMS version: Joomla
  • MySQL version: Latest
  • PHP version: Latest
Importing Membership and Contributions Together
May 05, 2013, 12:46:33 pm
Hello All

I am new to CiviCRM and trying to muddle my way through.
I have successfully imported my test Contacts and Contributions separately.

Going back, I noted there was no way to import both together.
How do I either import them together or link them together?

I would think that would be the easiest way, and there does not seem to be a way to do it.

Kind Regards
Scott

funkyblue

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 0
  • CiviCRM version: 4.4.2
  • CMS version: Joomla
  • MySQL version: Latest
  • PHP version: Latest
Re: Importing Membership and Contributions Together
May 08, 2013, 10:13:36 pm
Anyone?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Importing Membership and Contributions Together
May 09, 2013, 02:46:27 am
You should be able to link them via the email address I think.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

clarkac

  • Administrator
  • Ask me questions
  • *****
  • Posts: 399
  • Karma: 11
  • CiviCRM version: 4.4.11 & 4.5.5
  • CMS version: Drupal 7
  • MySQL version: 5.1.61-cll
  • PHP version: 5.3.27
Re: Importing Membership and Contributions Together
May 09, 2013, 07:57:42 am
...Or possibly on External Identifier, if you have it available in both contributions and membership.
Andy Clark

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Importing Membership and Contributions Together
May 09, 2013, 11:46:26 am
i think scott is wanting to know how to connect the contribution payment that relates to a specific membership.
i know we got round this somehow with eileen's migrations - check her on the blogs for 'migration' and there may be some hints. otherwise i will try and point her to this ticket later in the day
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

hbergin

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 6
  • CiviCRM version: 3.4.5 to 4.4.1
  • CMS version: Drupal 6.28 to 7.23
  • MySQL version: 5.5.34
  • PHP version: 5.3.10
Re: Importing Membership and Contributions Together
May 13, 2013, 09:25:28 am
I addressed this by:
1) adding my own chosen linking identifier in the source field for both the membership import and the matching contribution import.
2) using these linking identifiers in the hook_cron (or an overnight cron script) to write an INSERT sql statement that matches the records on the linking identifier and contact id, and then inserts entries into the civicrm_membership_payment table to link them.

I needed a linking identifier that was more unique than a contact identifier, so couldn't be the external identifier or the contact id, as there could be multiple memberships or contributions for a given contact. Once linked (inserted records in the civicrm_membership_payment table), then the source fields can be updated to whatever else may be desired. 

I avoided doing the insert link on the hook_civicrm_post to try to be more efficient by doing it in a cron batch.

funkyblue

  • I post occasionally
  • **
  • Posts: 32
  • Karma: 0
  • CiviCRM version: 4.4.2
  • CMS version: Joomla
  • MySQL version: Latest
  • PHP version: Latest
Re: Importing Membership and Contributions Together
May 17, 2013, 11:28:46 pm
Quote from: Hershel on May 09, 2013, 02:46:27 am
You should be able to link them via the email address I think.

That's the think, not everyone has an email address.
I did make sure all Contacts had a Unique ID which has made importing easier.

Quote from: hbergin on May 13, 2013, 09:25:28 am
I addressed this by:
1) adding my own chosen linking identifier in the source field for both the membership import and the matching contribution import.
2) using these linking identifiers in the hook_cron (or an overnight cron script) to write an INSERT sql statement that matches the records on the linking identifier and contact id, and then inserts entries into the civicrm_membership_payment table to link them.

I needed a linking identifier that was more unique than a contact identifier, so couldn't be the external identifier or the contact id, as there could be multiple memberships or contributions for a given contact. Once linked (inserted records in the civicrm_membership_payment table), then the source fields can be updated to whatever else may be desired. 

I avoided doing the insert link on the hook_civicrm_post to try to be more efficient by doing it in a cron batch.
.

Looks really complicated and went straight over my head.
I've hired someone to do the initial setup, so hopefully they can work it out. Will update on how we go!

Thanks
Scott


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Importing Membership and Contributions Together

This forum was archived on 2017-11-26.