From: Pratik Joshi Date: Thu, 10 Apr 2014 12:34:00 +0000 (+0530) Subject: CRM-13973-comment : intial financial_item entry of multiple entires being recorded... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=870f2eec8102e193fb7bd0466d91e8393ba956fe;p=civicrm-core.git CRM-13973-comment : intial financial_item entry of multiple entires being recorded during 'cancelled' status update on contribution (linked to participant) has amount = total_amount (which is incorrect) --- diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index d5e864997c..1093c2f5c0 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -992,11 +992,14 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $fieldType = NULL; if ($itemId && !empty($lineItems[$itemId]['price_field_id'])) { $fieldType = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $lineItems[$itemId]['price_field_id'], 'html_type'); + $this->_priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $lineItems[$itemId]['price_field_id'], 'price_set_id'); + } + + if ($this->_priceSetId && CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) { + $lineItems[$itemId]['unit_price'] = $lineItems[$itemId]['line_total'] = CRM_Utils_Rule::cleanMoney(CRM_Utils_Array::value('total_amount', $submittedValues)); } - $lineItems[$itemId]['unit_price'] = $lineItems[$itemId]['line_total'] = CRM_Utils_Rule::cleanMoney(CRM_Utils_Array::value('total_amount', $submittedValues)); // 10117 update th line items for participants if (!empty($lineItems[$itemId]['price_field_id'])) { - $this->_priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $lineItems[$itemId]['price_field_id'], 'price_set_id'); $lineItem[$this->_priceSetId] = $lineItems; } }