* @return int|mixed|null|string
*/
public static function computeAmount($params, $formValues) {
-
+ $amount = 0;
// First clean up the other amount field if present.
if (isset($params['amount_other'])) {
$params['amount_other'] = CRM_Utils_Rule::cleanMoney($params['amount_other']);
$amount = $params['amount_other'];
}
elseif (!empty($params['pledge_amount'])) {
- $amount = 0;
foreach ($params['pledge_amount'] as $paymentId => $dontCare) {
$amount += CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_PledgePayment', $paymentId, 'scheduled_amount');
}