From 372ad74dcc44b965db4a9343e66ccb5e5a45d5f6 Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Wed, 12 Mar 2014 12:36:13 +0530 Subject: [PATCH] CRM-13965-qa-fixes --- CRM/Core/BAO/ActionSchedule.php | 3 +++ CRM/Event/Form/Participant.php | 20 +++++--------------- templates/CRM/Event/Form/Participant.tpl | 11 +++++++++-- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index b30a7599eb..14a06eeb4c 100755 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -735,6 +735,9 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL $balancePay = CRM_Utils_Money::format($balancePay); $entityTokenParams["{$tokenEntity}." . $field] = $balancePay; } + elseif ($field == 'fee_amount') { + $entityTokenParams["{$tokenEntity}." . $field] = CRM_Utils_Money::format($dao->$field); + } else { $entityTokenParams["{$tokenEntity}." . $field] = $dao->$field; } diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 975e40159c..587cfc472e 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -849,6 +849,8 @@ SELECT civicrm_custom_group.name as name, $pendingInCartStatusId = array_search('Pending in cart', $participantStatusName); $this->assign('pendingInCartStatusId', $pendingInCartStatusId); $this->assign('enableCart', $enableCart); + $pendingRefundStatusId = array_search('Pending refund', $participantStatusName); + $this->assign('pendingRefundStatusId', $pendingRefundStatusId); $this->addElement('checkbox', 'is_notify', ts('Send Notification'), NULL); @@ -1057,8 +1059,7 @@ SELECT civicrm_custom_group.name as name, $params['fee_level'] = $params['amount_level']; $contributionParams['total_amount'] = $params['amount']; if ($this->_quickConfig && !empty($params['total_amount']) && - ($params['status_id'] != array_search('Partially paid', $participantStatus) && - $params['status_id'] != array_search('Pending refund', $participantStatus))) { + $params['status_id'] != array_search('Partially paid', $participantStatus)) { $params['fee_amount'] = $params['total_amount']; } else { //fix for CRM-3086 @@ -1411,10 +1412,7 @@ SELECT civicrm_custom_group.name as name, $contributionParams['partial_amount_pay'] = $params['total_amount']; } } - elseif ($params['status_id'] == array_search('Pending refund', $participantStatus)) { - $totalPaid = $params['total_amount']; - $updatedAmt = $amountOwed; - } + if ($this->_single) { if (empty($ids)) { $ids = array(); @@ -1465,8 +1463,7 @@ SELECT civicrm_custom_group.name as name, foreach ($value as $lineKey => $line) { //10117 update the line items for participants if contribution amount is recorded if ($this->_quickConfig && !empty($params['total_amount']) && - ($params['status_id'] != array_search('Partially paid', $participantStatus) && - $params['status_id'] != array_search('Pending refund', $participantStatus)) + ($params['status_id'] != array_search('Partially paid', $participantStatus)) ) { $line['unit_price'] = $line['line_total'] = $params['total_amount']; } @@ -1478,13 +1475,6 @@ SELECT civicrm_custom_group.name as name, } } - // record adjusted trxn entry for refund case - if ($this->_isPaidEvent && $params['status_id'] == array_search('Pending refund', $participantStatus) && - !empty($totalPaid) && !empty($updatedAmt)) { - $contributionDetail = $contributions[0]; - $contributionId = $contributionDetail->id; - CRM_Event_BAO_Participant::recordAdjustedAmt($updatedAmt, $totalPaid, $contributionId); - } $updateStatusMsg = NULL; //send mail when participant status changed, CRM-4326 if ($this->_id && $this->_statusId && diff --git a/templates/CRM/Event/Form/Participant.tpl b/templates/CRM/Event/Form/Participant.tpl index 8f07a89c03..0940a0758f 100644 --- a/templates/CRM/Event/Form/Participant.tpl +++ b/templates/CRM/Event/Form/Participant.tpl @@ -345,8 +345,15 @@ var $form = $('form#{/literal}{$form.formName}{literal}'); // don't show cart related statuses if it's disabled - var pendingInCartStatusId = {/literal}{$pendingInCartStatusId}{literal}; - $("#status_id option[value='" + pendingInCartStatusId + "']").remove(); + {/literal}{if !$enableCart}{literal} + var pendingInCartStatusId = {/literal}{$pendingInCartStatusId}{literal}; + $("#status_id option[value='" + pendingInCartStatusId + "']").remove(); + {/literal}{/if}{literal} + + {/literal}{if $action eq 1}{literal} + var pendingRefundStatusId = {/literal}{$pendingRefundStatusId}{literal}; + $("#status_id option[value='" + pendingRefundStatusId + "']").remove(); + {/literal}{/if}{literal} // Handle event selection $('#event_id', $form).change(function() { -- 2.25.1