From aee297c5895a117fe38a4264af50475fc29b59c8 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Wed, 29 Nov 2017 13:51:35 +0530 Subject: [PATCH] minor fixes --- CRM/Price/BAO/PriceField.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index aaff2d3414..31cd8c52fb 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -836,15 +836,16 @@ WHERE id IN (" . implode(',', array_keys($priceFields)) . ')'; list($componentName) = explode(':', $fields['_qf_default']); // now we have all selected amount in hand. $totalAmount = array_sum($selectedAmounts); - $actualTotalAmount = CRM_Utils_Array::value('partial_payment_total', $fields, CRM_Utils_Array::value('total_amount', $fields)); + // The form offers a field to enter the amount paid. This may differ from the amount that is due to complete the purchase + $totalPaymentAmountEnteredOnForm = CRM_Utils_Array::value('partial_payment_total', $fields, CRM_Utils_Array::value('total_amount', $fields)); if ($totalAmount < 0) { $error['_qf_default'] = ts('%1 amount can not be less than zero. Please select the options accordingly.', array(1 => $componentName)); } elseif ($totalAmount > 0 && - $actualTotalAmount >= $totalAmount && // if total amount is equal to all selected amount in hand + $totalPaymentAmountEnteredOnForm >= $totalAmount && // if total amount is equal to all selected amount in hand (CRM_Utils_Array::value('contribution_status_id', $fields) == CRM_Core_PseudoConstant::getKey('CRM_Contribute_DAO_Contribution', 'contribution_status_id', 'Partially paid')) ) { - $error['total_amount'] = ts('For partially paid contribution, amount must be less then the sum of all selected amount in hand'); + $error['total_amount'] = ts('You have specified the status Partially Paid but have entered an amount that equals or exceeds the amount due. Please adjust the status of the payment or the amount'); } } else { -- 2.25.1