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 CiviContribute (Moderator: Donald Lobo) »
  • Linking Event to a Contribution (adding Event Name on the New Contribution Form)
Pages: [1]

Author Topic: Linking Event to a Contribution (adding Event Name on the New Contribution Form)  (Read 644 times)

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Linking Event to a Contribution (adding Event Name on the New Contribution Form)
July 14, 2010, 11:33:12 am
I might be missing something simple here in my review of contributions.  Our finance team would like to use a single form to record all contribution types (regular donations, event fees, etc).  I looked into the New Contribution form, but I don't see any fields linking to an Event record (so that we can say this contribution is to pay for the fees tied to this particular event participant).

What we'd like to see is the Event Name and Event Participant fields to link the two (and, of course, have the Event record fees noted as paid).

Is there a way to link this information in the New Contribution form?  If I need to change the templates/code, could you give me pointers as to what needs to change (I'm not familiar enough with Contributions)?

Or is the only way to pay for Event Fees by going to the Event Participant record and submitting payment through that form?

Also, slightly off-topic, how would we allow for partial payments of an event fee? We have folks pay random amounts at different times (as long as the total is paid by the event date).
Thanks

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Linking Event to a Contribution (adding Event Name on the New Contribution Form)
July 14, 2010, 10:38:20 pm
It is not possible to have a single form process donations and event fees.

An event registration page will process event fees.

A donation (contribution) form will process your donations.

Regarding random payments at random times for events, this is a huge pain in the a$$, and best done over the phone and/or by check, not online through a form via credit card.   If someone wants to negotiate a partial payment, let that situation be the exception that is handled manually, rather than the rule.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

pbarmak

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 3
  • CiviCRM version: 3.3.5
  • CMS version: Pressflow 6.19
  • MySQL version: 5.1
  • PHP version: 5.2.10
Re: Linking Event to a Contribution (adding Event Name on the New Contribution Form)
July 15, 2010, 08:01:03 am
Quote from: Stoob on July 14, 2010, 10:38:20 pm
Regarding random payments at random times for events, this is a huge pain in the a$$, and best done over the phone and/or by check, not online through a form via credit card.   If someone wants to negotiate a partial payment, let that situation be the exception that is handled manually, rather than the rule.

Unfortunately, what you described is exactly our way of life in this ministry.  We have short-term mission teams go out and team members can't always pay their fees themselves, so they get sponsorships from others, who send checks and pay online at different times - we have to accept multiple payments (at different amounts) from multiple contributors per event participant.  Just a reality of what we do.

So, given that, I was thinking I can maybe work around this by using hooks.  But I need some pointers on what classes to use, what methods to call, etc (I'm not a pro with PHP, but can work my way through it with some pointers).  Here is what I was thinking of doing:
  • create event participant with fees as usual
  • don't mark the fees as paid - we'll insert a contribution record later (alternatively, we can mark it as paid with $0 as the amount to have the civicrm_participant_payment record being inserted for us)
  • have a couple of custom fields for Contributions: Team Number and Team Member (maybe make these dropdowns pre-populated from the event participant tables?)
  • create contributions, filling out those custom fields
  • create a hook (postProcess?) that takes the contribution and:
  • if the contribution type is "team fees", then, using the team number and team member custom fields, upsert the event contribution record to reflect the new total price (old amount + new contribution amount) - we need to add/update records in civicrm_contribution and civicrm_participant_payment to link them up.
  • this way we track specific contributions plus can see the total fees paid to date

How does this type of work-around sound?  What classes would I use to do the inserting/updating of the Event Participant Contribution record?  I can do all this via the database itself (got the DML statements down), but wondering if I should stick with the PHP methods in case things change later.

I understand some folks are working on this whole situation with CiviAccount (separating contributions from payments and event participants), but I'm not sure when that'll launch, so I figure a couple of hooks will help us until then.

Thanks for any pointers.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Linking Event to a Contribution (adding Event Name on the New Contribution Form)

This forum was archived on 2017-11-26.