diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 40c72970d95f..8681e186c3db 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -267,7 +267,6 @@ public function setDefaultValues() { elseif (!empty($priceFieldOption['is_default']) && (!isset($this->_defaults[$priceFieldName]) || ($val['html_type'] === 'CheckBox' && !isset($this->_defaults[$priceFieldName][$keys])))) { CRM_Price_BAO_PriceSet::setDefaultPriceSetField($priceFieldName, $keys, $val['html_type'], $this->_defaults); - $memtypeID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $this->_defaults[$priceFieldName], 'membership_type_id'); } } } diff --git a/CRM/Core/EntityTokens.php b/CRM/Core/EntityTokens.php index 88d5cc2de2d1..76def6b8acde 100644 --- a/CRM/Core/EntityTokens.php +++ b/CRM/Core/EntityTokens.php @@ -17,6 +17,7 @@ use Civi\ActionSchedule\Event\MailingQueryEvent; use Civi\Token\TokenProcessor; use Brick\Money\Money; +use Brick\Math\RoundingMode; /** * Class CRM_Core_EntityTokens @@ -126,7 +127,7 @@ public function evaluateToken(TokenRow $row, $entity, $field, $prefetch = NULL) } return $row->format('text/plain')->tokens($entity, $field, - Money::of($fieldValue, $currency)); + Money::of($fieldValue, $currency, NULL, RoundingMode::HALF_UP)); } if ($this->isDateField($field)) {