From 28cc62fcab1f265024b896f59ed17f9250159a08 Mon Sep 17 00:00:00 2001 From: pratikshad Date: Mon, 23 Feb 2015 19:03:25 +1000 Subject: [PATCH] CRM-15916 Fixed issue of membership renewal on batch data entry ---------------------------------------- * CRM-15916: Batch Data Entry - membership renewal issues https://issues.civicrm.org/jira/browse/CRM-15916 --- CRM/Batch/Form/Entry.php | 3 ++- templates/CRM/Batch/Form/Entry.tpl | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 5780c4a563..185c5421a7 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -714,7 +714,8 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { ); // make contribution entry - CRM_Member_BAO_Membership::recordMembershipContribution( array_merge($value, array('membership_id' => $membership->id))); + $contrbutionParams = array_merge($value, array('membership_id' => $membership->id)); + CRM_Member_BAO_Membership::recordMembershipContribution($contrbutionParams); } else { $membership = CRM_Member_BAO_Membership::create($value, CRM_Core_DAO::$_nullArray); diff --git a/templates/CRM/Batch/Form/Entry.tpl b/templates/CRM/Batch/Form/Entry.tpl index d756294336..905851fdaf 100644 --- a/templates/CRM/Batch/Form/Entry.tpl +++ b/templates/CRM/Batch/Form/Entry.tpl @@ -117,6 +117,14 @@ CRM.$(function($) { $($form).ajaxSubmit(options); }); + cj('input[id*="primary_contact_id_"]').change(function() { + var temp = this.id.split('_'); + var ROWID = temp[3]; + if (cj(this).val()) { + updateContactInfo(ROWID,'primary_'); + } + }); + $('#crm-container').on('keyup change', '*.selector-rows', function () { // validate rows checkColumns($(this)); @@ -288,7 +296,7 @@ function formatMoney(amount) { } function updateContactInfo(blockNo, prefix) { - var contactHiddenElement = 'input[name="' + prefix + 'contact_select_id[' + blockNo + ']"]'; + var contactHiddenElement = 'input[id="' + prefix + 'contact_id_' + blockNo + '"]'; var contactId = cj(contactHiddenElement).val(); var returnProperties = ''; -- 2.25.1