From 8684f61271abe73ab68aff7cc5f8fb6d6780ddfe Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Mon, 7 Aug 2017 22:23:01 +0100 Subject: [PATCH] Remove round that's no longer required --- CRM/Contribute/Form/Contribution/Confirm.php | 1 + CRM/Contribute/Form/Contribution/ThankYou.php | 1 + CRM/Price/BAO/LineItem.php | 5 ++--- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 206b7981e9..11262ce515 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -498,6 +498,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr * Build the form object. */ public function buildQuickForm() { + // FIXME: Some of this code is identical to Thankyou.php and should be broken out into a shared function $this->assignToTemplate(); $params = $this->_params; diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index 35162af957..7d9b66a501 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -88,6 +88,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont * Build the form object. */ public function buildQuickForm() { + // FIXME: Some of this code is identical to Confirm.php and should be broken out into a shared function $this->assignToTemplate(); $params = $this->_params; diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index cbe2c80d20..fa7af55627 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -300,9 +300,8 @@ WHERE li.contribution_id = %1"; ); $taxRates = CRM_Core_PseudoConstant::getTaxRates(); if (isset($lineItems[$dao->id]['financial_type_id']) && array_key_exists($lineItems[$dao->id]['financial_type_id'], $taxRates)) { - // We are close to output/display here - so apply some rounding at output/display level - to not show Tax Rate in all 8 decimals - // Cast to float so trailing zero decimals are removed. - $lineItems[$dao->id]['tax_rate'] = (float) round($taxRates[$lineItems[$dao->id]['financial_type_id']], 3); + // Cast to float so trailing zero decimals are removed for display. + $lineItems[$dao->id]['tax_rate'] = (float) $taxRates[$lineItems[$dao->id]['financial_type_id']]; } else { // There is no Tax Rate associated with this Financial Type -- 2.25.1