CRM-13105
authoryashodha <yashodha.chaku@webaccess.co.in>
Wed, 24 Jul 2013 13:29:59 +0000 (18:59 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Wed, 24 Jul 2013 13:29:59 +0000 (18:59 +0530)
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/Form/Task/Batch.php

index b41d2c0f0c86ffb461f1d03218e4632edf727185..87fcaa662c0b7f8d0ebf3321b4cf52f382c13a8a 100644 (file)
@@ -134,7 +134,8 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
     }
 
     // contribution status is missing, choose Completed as default status
-    if (!CRM_Utils_Array::value('contribution_status_id', $params)) {
+    // do this for create mode only
+    if (!CRM_Utils_Array::value('contribution', $ids) && !CRM_Utils_Array::value('contribution_status_id', $params)) {
       $params['contribution_status_id'] = CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name');
     }
 
index 92c90bb9de059142fceb8d7a2067ddfbab57d525..241557fa4cf3855e1139607ed04c6eb34944746c 100644 (file)
@@ -65,8 +65,8 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task {
    */
   function preProcess() {
     /*
-         * initialize the task and row fields
-         */
+     * initialize the task and row fields
+     */
     parent::preProcess();
 
     //get the contact read only fields to display.
@@ -156,7 +156,7 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task {
     //fix for CRM-2752
     $customFields = CRM_Core_BAO_CustomField::getFields('Contribution');
     foreach ($this->_contributionIds as $contributionId) {
-            $typeId = CRM_Core_DAO::getFieldValue( "CRM_Contribute_DAO_Contribution", $contributionId, 'financial_type_id' ); 
+      $typeId = CRM_Core_DAO::getFieldValue("CRM_Contribute_DAO_Contribution", $contributionId, 'financial_type_id');
       foreach ($this->_fields as $name => $field) {
         if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($name)) {
           $customValue = CRM_Utils_Array::value($customFieldID, $customFields);
@@ -254,7 +254,7 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task {
           $value['source'] = $value['contribution_source'];
         }
 
-                unset($value['financial_type']);
+        unset($value['financial_type']);
         unset($value['contribution_source']);
         $contribution = CRM_Contribute_BAO_Contribution::add($value, $ids);