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 (Moderator: Dave Greenberg) »
  • Contribution ID for offline Memberships
Pages: [1]

Author Topic: Contribution ID for offline Memberships  (Read 570 times)

graphicinnovations

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.3.7
  • CMS version: Joomla 2.5.11
  • MySQL version: 5.5.29
  • PHP version: 5.4.10
Contribution ID for offline Memberships
November 26, 2013, 04:33:53 pm
I'm trying to have the email invoice that is sent to the contact to have a invoice/receipt number by using the year and contribution number, now this works find for online payments, but is not where it's most important for me. Is there a way to get {$contributionID} to work for offline memberships(aka, when an admin inputs the membership from the back end and have the payment as "pending:pay later")?

I know these offline membership DO have contribution ID's as they are entered into the database, so what code do i need to change to get this to work?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Contribution ID for offline Memberships
November 26, 2013, 05:17:18 pm
First thing is to see if that value is already available to the message template. If you have test install, you can do this by adding the {debug} tag anywhere inside the message template text (in this case you would edit "Memberships - Signup and Renewal Receipts (off-line)" message template via Administer > Communication > Message Templates > System Workflow Messages).

Then enter the membership and check the output receipt. You'll see a block w/ all the available variables and their values.
Protect your investment in CiviCRM by  becoming a Member!

graphicinnovations

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.3.7
  • CMS version: Joomla 2.5.11
  • MySQL version: 5.5.29
  • PHP version: 5.4.10
Re: Contribution ID for offline Memberships
November 26, 2013, 05:39:38 pm
There is no {$contributionId} shown in the {debug} for that specific message template. Is there an easy way to set up a custom value or token that will manually grab what i need?

I don't really understand why they would make it so offline memberships cannot retrieve their Contribution ID while online ones can. As i've said before, it's not that the value doesn't exist, as it's in the data base and i can see more appear as i add another offline membership.

Any help with this would be great.  :)

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Contribution ID for offline Memberships
November 26, 2013, 06:00:22 pm
Looking at the code (in 4.4) - it looks to me like $contributionID is assigned in CRM/Member/Form/Membership.php emailReceipt() function (lines 1791 ++ )

Code: [Select]
    if (CRM_Utils_Array::value('contribution_id', $formValues)) {
      $form->assign('contributionID', $formValues['contribution_id']);
    }
    elseif (isset($form->_onlinePendingContributionId)) {
      $form->assign('contributionID', $form->_onlinePendingContributionId);
    }

You may have to debug in the code to figure out why you're not getting it ??
Protect your investment in CiviCRM by  becoming a Member!

graphicinnovations

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.3.7
  • CMS version: Joomla 2.5.11
  • MySQL version: 5.5.29
  • PHP version: 5.4.10
Re: Contribution ID for offline Memberships
November 26, 2013, 07:19:00 pm
I have this code as well, and I am currently working on a fresh install of 4.4.1 on Joomla 2.5.11 due to trying to troubleshoot this problem, I wanted to isolate it and rule out any other modification I had made.

I am not sure where to start with debugging the code for this, can you offer any assistance of this?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Contribution ID for offline Memberships
December 02, 2013, 04:27:32 pm
Did some more debugging in Membership.php and in the offline 'new membership' workflow the contribution_id variable is never set in $formValues (and is not available in $params at line 1634 where self::emailReceipt is called). You'll need to find a spot higher up in postProcess to grab it and assign to $formValues in order to make it available to the receipt message template.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Contribution ID for offline Memberships

This forum was archived on 2017-11-26.