From 15577398d51e85b74fe20b912bfde9138e21db48 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 28 Nov 2023 09:42:01 +1300 Subject: [PATCH] Update comment todos to referred to preferred method --- CRM/Batch/Form/Entry.php | 5 +---- CRM/Contribute/Form/AdditionalPayment.php | 5 +---- CRM/Contribute/Form/Contribution.php | 5 +---- CRM/Contribute/Form/Contribution/Confirm.php | 5 +---- CRM/Contribute/Form/ContributionBase.php | 4 +--- ext/eventcart/CRM/Event/Cart/Form/Checkout/Payment.php | 5 +---- 6 files changed, 6 insertions(+), 23 deletions(-) diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 4080ea1a93..7a472a9fe1 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -655,10 +655,7 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { $lineItem = []; CRM_Price_BAO_PriceSet::processAmount($this->_priceSet['fields'], $value, $lineItem[$priceSetId]); - // @todo - stop setting amount level in this function & call the CRM_Price_BAO_PriceSet::getAmountLevel - // function to get correct amount level consistently. Remove setting of the amount level in - // CRM_Price_BAO_PriceSet::processAmount. Extend the unit tests in CRM_Price_BAO_PriceSetTest - // to cover all variants. + // @todo - stop setting amount level in this function - use $this->order->getAmountLevel() unset($value['amount_level']); //CRM-11529 for back office transactions diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index 8a52b0dd28..92d5794ab0 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -370,10 +370,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract } $this->_params['amount'] = $this->_params['total_amount']; - // @todo - stop setting amount level in this function & call the CRM_Price_BAO_PriceSet::getAmountLevel - // function to get correct amount level consistently. Remove setting of the amount level in - // CRM_Price_BAO_PriceSet::processAmount. Extend the unit tests in CRM_Price_BAO_PriceSetTest - // to cover all variants. + // @todo - stop setting amount level in this function - use $this->order->getAmountLevel() $this->_params['amount_level'] = 0; $this->_params['currencyID'] = CRM_Utils_Array::value('currency', $this->_params, diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index a5bf294689..8c7e9f78b1 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -1179,10 +1179,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP } $this->_params['amount'] = $this->_params['total_amount']; - // @todo - stop setting amount level in this function & call the CRM_Price_BAO_PriceSet::getAmountLevel - // function to get correct amount level consistently. Remove setting of the amount level in - // CRM_Price_BAO_PriceSet::processAmount. Extend the unit tests in CRM_Price_BAO_PriceSetTest - // to cover all variants. + // @todo - stop setting amount level in this function - use $this->order->getAmountLevel() $this->_params['amount_level'] = 0; $this->_params['description'] = ts("Contribution submitted by a staff person using contributor's credit card"); $this->_params['currencyID'] = CRM_Utils_Array::value('currency', diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 7ae0b06378..76b894a576 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -1809,10 +1809,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr } if ($this->isQuickConfig() && !empty($this->_params["price_{$priceField->id}"])) { if ($this->_values['fee'][$priceField->id]['html_type'] != 'Text') { - // @todo - stop setting amount level in this function & call the CRM_Price_BAO_PriceSet::getAmountLevel - // function to get correct amount level consistently. Remove setting of the amount level in - // CRM_Price_BAO_PriceSet::processAmount. Extend the unit tests in CRM_Price_BAO_PriceSetTest - // to cover all variants. + // @todo - stop setting amount level in this function - use $this->order->getAmountLevel() // We expect this to be ignored. $this->_params['amount_level'] = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceFieldValue', $this->_params["price_{$priceField->id}"], 'label'); diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 90e7170a7c..ac4e5d27d7 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -714,9 +714,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { ]); } - // @todo - stop setting amount level in this function & call the CRM_Price_BAO_PriceSet::getAmountLevel - // function to get correct amount level consistently. Remove setting of the amount level in - // CRM_Price_BAO_PriceSet::processAmount. Extend the unit tests in CRM_Price_BAO_PriceSetTest + // @todo - stop setting amount level in this function - use $this->order->getAmountLevel() // to cover all variants. if (isset($this->_params['amount_other']) || isset($this->_params['selectMembership'])) { $this->_params['amount_level'] = ''; diff --git a/ext/eventcart/CRM/Event/Cart/Form/Checkout/Payment.php b/ext/eventcart/CRM/Event/Cart/Form/Checkout/Payment.php index ed358fedce..0adf8b1d6e 100644 --- a/ext/eventcart/CRM/Event/Cart/Form/Checkout/Payment.php +++ b/ext/eventcart/CRM/Event/Cart/Form/Checkout/Payment.php @@ -248,10 +248,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart { else { $cost = $event_price_values['amount']; } - // @todo - stop setting amount level in this function & call the CRM_Price_BAO_PriceSet::getAmountLevel - // function to get correct amount level consistently. Remove setting of the amount level in - // CRM_Price_BAO_PriceSet::processAmount. Extend the unit tests in CRM_Price_BAO_PriceSetTest - // to cover all variants. + // @todo - stop setting amount level in this function - use $this->order->getAmountLevel() $amount_level = $event_price_values['amount_level']; $price_details[$price_set_id] = $price_set_amount; } -- 2.25.1