From 0637f079194251b0943af99c52cbb1e351666604 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 19 Jan 2020 11:24:07 +1300 Subject: [PATCH] [REF] Move assignment of BalanceAmount This moves the assignment of balanceAmount to where the partial_payment_total is determined. Template assignments happen all over the place so it makes more sense to group this which where the values are determined --- CRM/Event/Form/Participant.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index bcd441f278..69fdc0bebf 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1343,6 +1343,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment $contributionParams['partial_payment_total'] = $amountOwed; // the actual amount paid $contributionParams['partial_amount_to_pay'] = $params['total_amount']; + $this->assign('balanceAmount', $contributionParams['partial_payment_total'] - $contributionParams['partial_amount_to_pay']); } } @@ -1446,11 +1447,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment } $this->assign('totalAmount', $contributionParams['total_amount']); - if (isset($contributionParams['partial_payment_total'])) { - // balance amount - $balanceAmount = $contributionParams['partial_payment_total'] - $contributionParams['partial_amount_to_pay']; - $this->assign('balanceAmount', $balanceAmount); - } $this->assign('isPrimary', 1); $this->assign('checkNumber', CRM_Utils_Array::value('check_number', $params)); } -- 2.25.1