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) »
  • Import contribution & associate with an existing event
Pages: [1]

Author Topic: Import contribution & associate with an existing event  (Read 873 times)

magnolia61

  • I post occasionally
  • **
  • Posts: 37
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34 / Joomla 3.3.6
  • MySQL version: MySQL 5.5.40
  • PHP version: PHP 5.5.19
Import contribution & associate with an existing event
December 29, 2014, 11:54:54 am
Hello,

When importing contributions it is currently not possible to choose the Event ID as a Matching CiviCRM Field. This means that when importing contributions currently you cannot associate them with events. The contributions get imported but have no association with the event they belong to (even though we have the event ID ready to go in our CSV files).

Solution: add the "Event ID" in the list of Matching CiviCRM fields in the Import Contributions Wizzard
I filed a JIRA issue for this (https://issues.civicrm.org/jira/browse/CRM-13393?filter=-2)

The only underlying thing that needs to happen is that during import an entry in the civicrm_participant_payment table needs to be created to associate the contribution with the participant

civicrm_participant_payment table
id -- participant_id --- contribution_id

I cannot code this myself but does anyone have an idea on how to approach this? (I mean: which files, which mechanism, would it be very difficult?)

Any help is appreciated! :-)
« Last Edit: December 29, 2014, 12:09:32 pm by magnolia61 »

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Import contribution & associate with an existing event
December 29, 2014, 12:39:30 pm
Hi Richard,

The feature you're asking for also makes sense to add for contributions that are connected to a membership.

There's a roadblock to the plan as you've laid it out - and a semi-solution as well.

First - you want to import an event ID, and create a record in civicrm_participant_payment.  However, you would also need to create a record in civicrm_participant.  In theory, this isn't hard, but it only handles one use case.  I think there'd soon be complaints from folks who wanted to connect an existing participant record to a contact, who wanted to set participant role/status, etc. - essentially, one would have to merge the "import participants" with "import contributions" entirely.  I think it'd be a pretty big undertaking to do this robustly - and I don't think there's a call for adding a weak implementation in the core product.

That said - there's a few ways to do this today, using the API, without changing the core code.
* You could install the CiviCRM API CSV import GUI extension (https://civicrm.org/extensions/api-csv-import-gui).  I'm not sure if this supports chained API calls; if it does, you're golden.  If not, you should hire someone (like Eileen, who wrote this extension) to implement chained API calls.

* If you're unwilling to hire someone to add this feature, you can use the API CSV Import GUI to do the import in 2-3 parts.  Import the contribution (w/o the event ID), import the participant ID, then import the participant_payment record.  It's unpleasant, but better tedious than impossible!

I have a client in a similar situation - they need to import new contacts, a membership record, a contribution, and a membership_payment, all in a single import.  We're going to write them a custom extension - though maybe I'll check out how much work it'd be to add chained API calls to Eileen's extension.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Import contribution & associate with an existing event
February 16, 2015, 01:35:08 pm
For what it's worth, I installed the CSV API GUI extension, and it does NOT support API chaining.  I'm going to look into a different solution here.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Import contribution & associate with an existing event

This forum was archived on 2017-11-26.