Skip to content

Commit

Permalink
Merge pull request #25 from kurund/fatal-error-fixes
Browse files Browse the repository at this point in the history
fatal error fixes when amount is greater than 1000 and extra fee is  checked
  • Loading branch information
jitendrapurohit authored Sep 21, 2023
2 parents 205783d + cdfd60c commit c20ea27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CRM/Extrafee/Fee.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,20 @@ public static function modifyTotalAmountInParams($formName, &$form, $extraFeeSet
if ($formName == 'CRM_Contribute_Form_Contribution_Main') {
if (!empty($form->_amount)) {
$form->_amount += $form->_amount * $percent/100 + $processingFee;
$form->_amount = number_format($form->_amount, 2);
$form->_amount = round(CRM_Utils_Rule::cleanMoney($form->_amount), 2);
$form->set('amount', $form->_amount);
}
elseif ($amt = $form->get('amount')) {
$form->_amount = $amt + $amt * $percent/100 + $processingFee;
$form->_amount = number_format($form->_amount, 2);
$form->_amount = round(CRM_Utils_Rule::cleanMoney($form->_amount), 2);
$form->set('amount', $form->_amount);
}
}
elseif ($formName == 'CRM_Event_Form_Registration_Register') {
$params = $form->getVar('_params');
if (!empty($params[0]['amount'])) {
$params[0]['amount'] += $params[0]['amount'] * $percent/100 + $processingFee;
$params[0]['amount'] = number_format($params[0]['amount'], 2);
$params[0]['amount'] = round(CRM_Utils_Rule::cleanMoney($params[0]['amount']), 2);
$form->setVar('_params', $params);
$form->set('params', $params);
}
Expand Down

0 comments on commit c20ea27

Please sign in to comment.