Merge pull request #21876 from mariav0/patch-14
[civicrm-core.git] / CRM / Pledge / Form / Pledge.php
index d87fd52fb9054eb55c38d1757f26f94db50d065a..d3759d761dc7ef216d80f1bc77902cdbae0a7b0a 100644 (file)
@@ -127,12 +127,12 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
       // fix the display of the monetary value, CRM-4038.
       if ($this->_isPending) {
         $defaults['eachPaymentAmount'] = $this->_values['amount'] / $this->_values['installments'];
-        $defaults['eachPaymentAmount'] = CRM_Utils_Money::format($defaults['eachPaymentAmount'], NULL, '%a');
+        $defaults['eachPaymentAmount'] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($defaults['eachPaymentAmount']);
       }
 
       // fix the display of the monetary value, CRM-4038
       if (isset($this->_values['amount'])) {
-        $defaults['amount'] = CRM_Utils_Money::format($this->_values['amount'], NULL, '%a');
+        $defaults['amount'] = CRM_Utils_Money::formatLocaleNumericRoundedForDefaultCurrency($this->_values['amount']);
       }
       $this->assign('amount', $this->_values['amount']);
       $this->assign('installments', $defaults['installments']);
@@ -488,7 +488,6 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     if (!empty($formValues['hidden_custom'])) {
       $params['hidden_custom'] = 1;
 
-      $customFields = CRM_Core_BAO_CustomField::getFields('Pledge');
       $params['custom'] = CRM_Core_BAO_CustomField::postProcess($formValues,
         $this->_id,
         'Pledge'