dev/financial/issues/28, Financial Account cannot be change to non deductible
authorPradeep Nayak <pradpnayak@gmail.com>
Tue, 17 Jul 2018 20:35:46 +0000 (02:05 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Tue, 17 Jul 2018 20:57:46 +0000 (02:27 +0530)
CRM/Financial/Form/FinancialAccount.php

index 5b9b8f49c310fa0d3065ededd9f8272081fccf01..1b1eb9e3acf55ec3743d77a1b5bb08284f49f972 100644 (file)
@@ -200,7 +200,14 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
       if ($this->_action & CRM_Core_Action::UPDATE) {
         $params['id'] = $this->_id;
       }
-
+      foreach ([
+        'is_active',
+        'is_deductible',
+        'is_tax',
+        'is_default',
+      ] as $field) {
+        $params[$field] = CRM_Utils_Array::value($field, $params, FALSE);
+      }
       $financialAccount = CRM_Financial_BAO_FinancialAccount::add($params);
       CRM_Core_Session::setStatus(ts('The Financial Account \'%1\' has been saved.', array(1 => $financialAccount->name)), ts('Saved'), 'success');
     }