From 09b946d7ef93becd2895e2d29e57a7b4d667e4e5 Mon Sep 17 00:00:00 2001 From: Wouter H Date: Fri, 8 Feb 2019 22:58:12 +0100 Subject: [PATCH] Refs #706 Edit contribution : wrong decimal separator on total_amount for participant(s) --- CRM/Contribute/Form/Contribution.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index e9c86d36de..d1b1e06d12 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -366,16 +366,14 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()); // Fix the display of the monetary value, CRM-4038. - if (isset($defaults['total_amount'])) { + if ($total_value = isset($defaults['total_amount'])) { + $defaults['total_amount'] = CRM_Utils_Money::format($defaults['total_amount'], NULL, '%a'); if (!empty($defaults['tax_amount'])) { $componentDetails = CRM_Contribute_BAO_Contribution::getComponentDetails($this->_id); if (!(CRM_Utils_Array::value('membership', $componentDetails) || CRM_Utils_Array::value('participant', $componentDetails))) { - $defaults['total_amount'] = CRM_Utils_Money::format($defaults['total_amount'] - $defaults['tax_amount'], NULL, '%a'); + $defaults['total_amount'] = CRM_Utils_Money::format($total_value - $defaults['tax_amount'], NULL, '%a'); } } - else { - $defaults['total_amount'] = CRM_Utils_Money::format($defaults['total_amount'], NULL, '%a'); - } } $amountFields = array('non_deductible_amount', 'fee_amount'); -- 2.25.1