CRM-21005, set amount to default owed
authorPradeep Nayak <pradpnayak@gmail.com>
Fri, 4 Aug 2017 05:40:03 +0000 (11:10 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Fri, 4 Aug 2017 05:40:03 +0000 (11:10 +0530)
----------------------------------------
* CRM-21005: "Record Payment" dialogue lacks required field and is clunky
  https://issues.civicrm.org/jira/browse/CRM-21005

CRM/Contribute/Form/AdditionalPayment.php

index 33ce175032b2a06c30ef6a2d81eed30c92e2cf39..5364465de56e96ad2b50f0d51e17079866ef4e38 100644 (file)
@@ -186,6 +186,9 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract
     if ($this->_refund) {
       $defaults['total_amount'] = abs($this->_refund);
     }
+    elseif ($this->_owed) {
+      $defaults['total_amount'] = number_format($this->_owed, 2);
+    }
 
     // Set $newCredit variable in template to control whether link to credit card mode is included
     $this->assign('newCredit', CRM_Core_Config::isEnabledBackOfficeCreditCardPayments());