CRM-19587, donot delete financial account if its present in civicrm_financial_item...
authorPradeep Nayak <pradpnayak@gmail.com>
Mon, 31 Oct 2016 13:18:19 +0000 (18:48 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Wed, 2 Nov 2016 08:09:26 +0000 (13:39 +0530)
----------------------------------------
* CRM-19587: DB Error when trying to delete FInancial Account
  https://issues.civicrm.org/jira/browse/CRM-19587

CRM/Financial/BAO/FinancialAccount.php

index af7d05e28231d18eb59c436917c8e8fbd2fa2fe4..03902b4da8170002558bfbd53b0fe1ccf1dbe9e9 100644 (file)
@@ -144,6 +144,7 @@ class CRM_Financial_BAO_FinancialAccount extends CRM_Financial_DAO_FinancialAcco
     $dependency = array(
       array('Core', 'FinancialTrxn', 'to_financial_account_id'),
       array('Financial', 'FinancialTypeAccount', 'financial_account_id'),
+      array('Financial', 'FinancialItem', 'financial_account_id'),
     );
     foreach ($dependency as $name) {
       require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_" . $name[0] . "_BAO_" . $name[1]) . ".php";