Skip to content

Commit

Permalink
refs #24801, fixes amount_level not being record on contribution.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimyhuang committed Feb 20, 2019
1 parent 353db9b commit 643a013
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CRM/Event/Form/Registration/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,12 @@ static function processContribution(&$form, $params, $result, $contactID,
$params['amount_level'] = $params['amount_level'] . ts(' (multiple participants)') . CRM_Core_BAO_CustomOption::VALUE_SEPERATOR;
}

$coupon = $form->get('coupon');
if(!empty($coupon)){
$couponDescription = ts('Coupon').'-'.$coupon['code'].'-'.$coupon['description'].': -'.$form->_totalDiscount;
$params['amount_level'] .= $couponDescription.CRM_Core_BAO_CustomOption::VALUE_SEPERATOR;
}

$contribParams = array(
'contact_id' => $contactID,
'contribution_type_id' => $form->_values['event']['contribution_type_id'] ?
Expand Down Expand Up @@ -1038,7 +1044,6 @@ static function processContribution(&$form, $params, $result, $contactID,
// create contribution record
$contribution = &CRM_Contribute_BAO_Contribution::add($contribParams, $ids);

$coupon = $form->get('coupon');
if(!empty($coupon)){
CRM_Coupon_BAO_Coupon::addCouponTrack($coupon['id'], $contribution->id, $contribution->contact_id, $form->_totalDiscount);
}
Expand Down

0 comments on commit 643a013

Please sign in to comment.