Answers.Body: <p>I would advise you to avoid changing the core files (php or template). You should write an extension that adds the field (in the buildform hook) and save it whilst processing the form.</p>
  
  <p>However, It might be better to use other ways to save that information. The financial type for instance where you can create several, based on the bank (assuming it's the client bank) or use the check number or source (both existing fields in the contribution) if it's an information about the member's bank.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-16T10:25:21.593Z
Answers.Text: Thanks a lot Xavier, we decided to use check number to store the bank name !
Answers.UserDisplayName: matthias de mauroy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-15T15:23:43.203Z
Answers.LastActivityDate: 2015-04-15T15:23:43.203Z
Answers.UserDisplayName: Xavier
Body: <p>I ran into this problem for a client who needs to specify, when renewing a membership, the bank name.</p>
  
  <p>So I decided to store this value into contribution note, but when renewing, this field does not appears in the form.</p>
  
  <p>I added this on line 409 of CRM_Member_Form_MembershipRenewal.php</p>
  
  <pre><code>   $this-&gt;add('text', 'contribution_note', ts('Note'),
      CRM_Core_DAO::getAttribute('CRM_Core_DAO_Note', 'note')
    );
  </code></pre>
  
  <p>And this on line 730 of CRM_Member_Form_MembershipRenewal.php</p>
  
  <pre><code>$note = new CRM_Core_DAO_Note();
  $note-&gt;entity_table = 'civicrm_contribution';
  $note-&gt;entity_id = $temporaryParams['contribution_id'];
  $note-&gt;note = $formValues['contribution_note'];      
  $note-&gt;contact_id = $formValues['contact_id'];
  $note-&gt;modified_date = CRM_Utils_Date::getToday();
  $note-&gt;privacy = 0;
  $note-&gt;save();    
  </code></pre>
  
  <p>Here is the .tpl modification on line 176</p>
  
  <pre><code>&lt;tr id="contributionNote" class="crm-member-membershiprenew-form-block-contribution_note"&gt;
  &lt;td class="label"&gt;{$form.contribution_note.label}&lt;/td&gt;
  &lt;td&gt;{$form.contribution_note.html}&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
Tags: <contributions>
Title: Is it possible to add contribution note when renewing membership in (one of) the next release?
ThreadText: # Is it possible to add contribution note when renewing membership in (one of) the next release?
  
  (Asked by: username_0 on 2015-04-15)
  
  I ran into this problem for a client who needs to specify, when renewing a membership, the bank name.
  
  So I decided to store this value into contribution note, but when renewing, this field does not appears in the form.
  
  I added this on line 409 of CRM\_Member\_Form\_MembershipRenewal.php
  
  ```
     $this->add('text', 'contribution_note', ts('Note'),
      CRM_Core_DAO::getAttribute('CRM_Core_DAO_Note', 'note')
    );
  
  ```
  
  And this on line 730 of CRM\_Member\_Form\_MembershipRenewal.php
  
  ```
  $note = new CRM_Core_DAO_Note();
  $note->entity_table = 'civicrm_contribution';
  $note->entity_id = $temporaryParams['contribution_id'];
  $note->note = $formValues['contribution_note'];      
  $note->contact_id = $formValues['contact_id'];
  $note->modified_date = CRM_Utils_Date::getToday();
  $note->privacy = 0;
  $note->save();    
  
  ```
  
  Here is the .tpl modification on line 176
  
  ```
  <tr id="contributionNote" class="crm-member-membershiprenew-form-block-contribution_note">
  <td class="label">{$form.contribution_note.label}</td>
  <td>{$form.contribution_note.html}</td>
  </tr>
  
  ```
  
  **Tags:** contributions
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-04-15. Score: 1 | Accepted answer
  
  I would advise you to avoid changing the core files (php or template). You should write an extension that adds the field (in the buildform hook) and save it whilst processing the form.
  
  However, It might be better to use other ways to save that information. The financial type for instance where you can create several, based on the bank (assuming it's the client bank) or use the check number or source (both existing fields in the contribution) if it's an information about the member's bank.
  
  > **Comments:**
  > **username_0**: Thanks a lot username_1, we decided to use check number to store the bank name !  
  
  ---
  
  