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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Event free places
Pages: [1]

Author Topic: Event free places  (Read 2096 times)

chrisivens

  • Guest
Event free places
February 08, 2009, 01:25:24 pm
Things are getting a bit tricky here to work out. I have memberships that define a number of free places. The only thing now is to figure out how they are assigned and counted. Have a look at the possible scenarios and let me know if you have a way of counting them etc. Scenarios PDF

chrisivens

  • Guest
Re: Event free places
February 09, 2009, 08:14:10 am
Okay it's very confusing.

In essence, A membership (defined by the grey box at the top with the number in) allows a certain number of free places. A membership either goes directly to a contact record OR it goes to a record and then cascades down to one or more other contacts using the membership relationship options.

If a contact is a member of more than one membership type, how do I count their free places allocation AND how do I tell when they've used it up?

I could go on for hours trying to explain myself. Please grab me in irc if you need a bit more info.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Event free places
February 09, 2009, 06:23:44 pm
Not sure I understand fully what you're trying to accomplish. However, it seems like one thing you need to know is the list of contact record ID's linked to a given membership (including the contacts who inherit the membership from another contact).

The owner_membership_id in civicrm_membership links inherited memberships to the "primary member". For example, if I wanted to find out all the contacts who have inherited membership from contact 5 ...
Code: [Select]
SELECT contact_id
FROM `civicrm_membership`
WHERE owner_membership_id
IN ( SELECT id FROM civicrm_membership WHERE contact_id =5
)

You could then get a count on the civicrm_participant records for the event you are interested in, where contact_id is in the list returned above.

Not sure this is on track for what you're trying to do. Hopefully it's a start. Else, I guess pinging one of us on IRC is your best bet.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Event free places

This forum was archived on 2017-11-26.