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) »
  • Calculated Dues payments?
Pages: [1]

Author Topic: Calculated Dues payments?  (Read 773 times)

epmcl

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Calculated Dues payments?
May 20, 2010, 02:58:32 pm
I initially posted this to CiviMembers, but it's might be more appropriate here.

I am trying to come up with the best way of handling calculated dues payments on the Member Dues/Renewal form.

By "calculated dues", I mean the total cost of membership being equal to a base price plus a variable amount. In my case, the variable amount is calculated by the number of employees in an organization multiplied by a fixed value, which I'll call "the multiplier".

Here's an example of member dues for an organization with 100 employees:

Base annual Dues: $150
Multiplier: 12.5%
Dues = $150 + (100 * .125) = $162.50

Setting the base dues is simple; it's just defined on the Membership Type. It's the variable part that is tricky. That needs to get calculated and plugged into the dues/renewal form from a value provided by the user at run time.

From what I've read, there doesn't appear to be any functionality in CiviMember (yet?) that will support calculated dues like this. If I'm wrong on that, please let me know (and point me to a reference, if you can).

I have thought that one way to do it would be to provide an additional contribution field, providing the user with instructions on how to calculate the variable amount and let them enter it there.

Another thought I had was to use custom data fields on the member type for the number of employees, with the variable vlaue field being processed with a PHP hook, but that's problematic for a number of reasons, technical and usability.

Another thought I had was using AJAX to do the calcutions and populate the additional contribution field from data the user entered in custom fields. Is that doable?

Your ideas on this are welcome.

Thanks!

Ed

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Calculated Dues payments?
May 20, 2010, 05:31:21 pm
Quote from: epmcl on May 20, 2010, 02:58:32 pm
I have thought that one way to do it would be to provide an additional contribution field, providing the user with instructions on how to calculate the variable amount and let them enter it there.

Another thought I had was using AJAX to do the calcutions and populate the additional contribution field from data the user entered in custom fields. Is that doable?

I would go with one of the above two options. The latter is much better and user friendly. u'll need to explain to the user how it is computed to make things clear

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Calculated Dues payments?

This forum was archived on 2017-11-26.