// as a point of fragility rather than a logical 'if' clause.
if ($priceSetId) {
CRM_Price_BAO_PriceSet::processAmount($this->_priceSet['fields'],
- $submittedValues, $lineItem[$priceSetId]);
+ $submittedValues, $lineItem[$priceSetId], NULL, $priceSetId);
// Unset tax amount for offline 'is_quick_config' contribution.
// @todo WHY - quick config was conceived as a quick way to configure contribution forms.
// this is an example of 'other' functionality being hung off it.
// would cause breakage for negative values in some cases.
$submittedValues['total_amount'] = CRM_Utils_Array::value('amount', $submittedValues);
}
+
if ($this->_id) {
if ($this->_compId) {
if ($this->_context == 'participant') {
// get the required field value only.
- $params = $ids = array();
-
- $params['contact_id'] = $this->_contactID;
- $params['currency'] = $this->getCurrency($submittedValues);
+ $params = [
+ 'contact_id' => $this->_contactID,
+ 'currency' => $this->getCurrency($submittedValues),
+ 'skipCleanMoney' => TRUE,
+ 'id' => $this->_id,
+ ];
//format soft-credit/pcp param first
CRM_Contribute_BAO_ContributionSoft::formatSoftCreditParams($submittedValues, $this);
$params[$f] = CRM_Utils_Array::value($f, $formValues);
}
- // CRM-5740 if priceset is used, no need to cleanup money.
- if ($priceSetId) {
- $params['skipCleanMoney'] = 1;
- }
$params['revenue_recognition_date'] = NULL;
if (!empty($formValues['revenue_recognition_date'])
&& count(array_filter($formValues['revenue_recognition_date'])) == 2
$params['is_pay_later'] = 0;
}
- $ids['contribution'] = $params['id'] = $this->_id;
-
// Add Additional common information to formatted params.
CRM_Contribute_Form_AdditionalInfo::postProcessCommon($formValues, $params, $this);
if ($pId) {
if (!empty($params['note']) && !empty($submittedValues['note'])) {
unset($params['note']);
}
- $contribution = CRM_Contribute_BAO_Contribution::create($params, $ids);
+ $contribution = CRM_Contribute_BAO_Contribution::create($params);
// process associated membership / participant, CRM-4395
if ($contribution->id && $action & CRM_Core_Action::UPDATE) {