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 CiviMember (Moderator: Deepak Srivastava) »
  • Receive_date not showing in off-line membership receipts in some cases.
Pages: [1]

Author Topic: Receive_date not showing in off-line membership receipts in some cases.  (Read 651 times)

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Receive_date not showing in off-line membership receipts in some cases.
July 07, 2012, 07:21:34 am
If  I sign up a (paid) member off-line using either the organisation and member type or a price set, the current date shows on the (default) receipt emails that I send at the time I record the payment.

If I renew a member off-line , the current date does not show on the receipt emails that I send at the time I record the payment.

If I resend the membership receipt email at a later time, the processing/payment date does not show up on either the  sign up or renewal emails.

The relevant code is:

      {if $receive_date}
        <tr>
         <td {$labelStyle}>
          {ts}Date Paid{/ts}
         </td>
         <td {$valueStyle}>
          {$receive_date|truncate:10:''|crmDate}
         </td>
        </tr>
       {/if}

I can't check properly on the demo site because it doesn't send emails,  but my default receipt template is identical to that on the demo site 

This same code is also in the off-line contribution receipts.  If I resend them at a later date rather than the membership receipts, the receive_date is shown.

However, our membership receipts contain extra customised information for each individual, so I really want to be able to resend them if required.

If I add the code:

{if $receiptType EQ 'membership renewal'}
     <tr>
         <td {$labelStyle}>
          {ts}Date Paid{/ts}
         </td>
         <td {$valueStyle}>
          {$smarty.now|date_format:'%e %B %Y'}
         </td>
      </tr>
{/if} 

I can get the correct date to show on the renewal receipts on the day I process them, but obviously if I resend the receipts at a later date the date of resending shows not the original date.

I have checked in the Civicrm_contribute table and the receive_date is recorded for all off-line sign ups and renewals.

Is anyone able to offer any suggestions?
 

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: Receive_date not showing in off-line membership receipts in some cases.
July 07, 2012, 07:40:52 am

Seems like we do not send the receive_date (or dont set it to the right value) when we sent it over to smarty. Can you take a look at the code and help figure out what is happening and why

thanx

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

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Receive_date not showing in off-line membership receipts in some cases.
July 08, 2012, 12:58:34 am
Thanks for your reply Lobo.

I don't actually have access to the code, but could ask my implementers to look, however, having delved a little deeper in relation to other issues I think it is a lost cause.

As stated in my original post I can modify the Memberships - Signup and Renewal Receipts (off-line) template so that the correct date shows on renewal receipts sent on the day they are processed. (Perhaps this could be considered as an inclusion for the default template?)

So what I was really after was a way to get the receive date to show if I have to resend the membership receipt.

And this is the 'lost cause' part of it I think. (Although I have no experience with PHP and so could be talking nonsense.)

The only place the receive date is currently held is the contribution table. 

There is a one-to-many relationship between membership_id and contribution_ids so it may be difficult to get the last renewal date out of the contributions table if the starting point is the membership_Id which I suppose it is when resending a membership receipt.

For this and other reasons I think it would worthwhile adding a column called last_renewal_date to the membership table.  It's default would be null and it would be overwritten with the appropriate date whenever a membership was renewed.


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: Receive_date not showing in off-line membership receipts in some cases.
July 08, 2012, 06:55:06 am

given the membership id we should be able to get the contribution id and contribution received date via a SQL query and expose it to the template.

I think the solution should do that rather than your previous patch of using the current date, which will not work (as u discovered) during resending

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 CiviMember (Moderator: Deepak Srivastava) »
  • Receive_date not showing in off-line membership receipts in some cases.

This forum was archived on 2017-11-26.