From c463665d9922ddfa437d50f3a7bfb8ef32629f4b Mon Sep 17 00:00:00 2001 From: yashodha Date: Fri, 3 May 2013 06:13:22 +0530 Subject: [PATCH] CRM-12463 --- CRM/Contribute/Form/Contribution.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 351deffc59..91eebcd0fa 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -966,8 +966,12 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP } if (!empty($fields['soft_credit_amount'])) { + $repeat = array_count_values($fields['soft_credit_contact_select_id']); foreach ($fields['soft_credit_amount'] as $key => $val) { if (!empty($fields['soft_credit_contact_select_id'][$key])) { + if ($repeat[$fields['soft_credit_contact_select_id'][$key]] > 1) { + $errors["soft_credit_contact_select_id[$key]"] = ts('You cannot enter multiple soft credits for the same contact.'); + } if ($fields['soft_credit_amount'][$key] && ($fields['soft_credit_amount'][$key] > $fields['total_amount'])) { $errors["soft_credit_amount[$key]"] = ts('Soft credit amount cannot be more than the total amount.'); } -- 2.25.1