Answers.Body: <p>This was due to the exception thrown on an AJAX pop. A fix has been raised for it at <a href="https://github.com/civicrm/civicrm-core/pull/10651" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/10651</a>.</p>
  
  <p>Hopefully it will be a part of 4.7.23 release.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-13T11:29:38.180Z
Answers.LastActivityDate: 2017-07-13T11:29:38.180Z
Answers.UserDisplayName: jitendra - fuzion
Answers.Body: <p>I am afraid that CiviCRM on this side is less flexible as it seems. Here is a fragment of the file <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Financial/BAO/FinancialAccount.php" rel="nofollow noreferrer">FinancialAccount.php Line 282</a>. </p>
  
  <pre><code>$Links = array(
    'Expense Account is' =&gt; 'Expenses',
    'Accounts Receivable Account is' =&gt; 'Asset',
    'Income Account is' =&gt; 'Revenue',
    'Asset Account is' =&gt; 'Asset',
    'Cost of Sales Account is' =&gt; 'Cost of Sales',
    'Premiums Inventory Account is' =&gt; 'Asset',
    'Discounts Account is' =&gt; 'Revenue',
    'Sales Tax Account is' =&gt; 'Liability',
    'Deferred Revenue Account is' =&gt; 'Liability',
    'Refunds to' =&gt; 'Liability',
  );
  </code></pre>
  
  <p>It shows that the code makes strong assumptions about the defined account relationships. You can add your custom account relationship in this place, and you then you can use the screen to connect it to financial types. But I think it is safer to figure out how your extension can work within the existing financial schemes.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-09T11:48:09.017Z
Answers.LastActivityDate: 2016-12-09T11:48:09.017Z
Answers.UserDisplayName: Kainuk - CiviCooP
Body: <p>I have run into an issue and I'm not sure if it's a bug or if i'm not understanding how Civi is using the Financial Accounts. </p>
  
  <p>I have created a new account relationship called "Fund" in the option groups.
  I created a Financial Account called "General Fund" as an Asset (EQUITY) account type.
  I attempted to assign the Financial Account "General Fund" with a relationship of Fund to the Financial Type Donation. Civi just sits and spins when I click on assign account and never actually adds the account to the Financial Type. </p>
  
  <p>The reason I'm doing this is so that an extension that I'm having written can pull that info from Civi to import into my accounting software. </p>
  
  <p>Edit: I was able to replicate this on my site and the demo.  </p>
  
  <p>I'm running 4.7.11 and Drupal 7. The demo is running 4.7.13</p>
  
  <p><strong>EDIT</strong> I checked the database just to see if there was something different with the financial type and account that I created. I did notice that in the civicrm_option_value table that the row for the account relationship I created the column component_id was blank and all the others were set to 2. I changed the one I entered to 2 (it didn't make a difference). </p>
  
  <p>I tried adding the account to the type manually in the database and it shows up in the UI. I can't edit it through the UI but it's there. </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-05T00:07:26.310Z
Comments.Text: I replicated this on dmaster and got following: Sorry but we are not able to provide this at the moment.
  This financial account cannot have 'PD test' relationship.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-09T11:35:19.093Z
Comments.Text: I reported this as https://issues.civicrm.org/jira/browse/CRM-19739 .
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-07T19:35:00.187Z
Comments.Text: I have assigned the above to one of our team to do as part of our community effort.
Comments.UserDisplayName: petednz - fuzion
Tags: <issues><accounting><financial-types><financial-accounts>
Title: Unable to add financial account
ThreadText: # Unable to add financial account
  
  (Asked by: username_0 on 2016-12-02)
  
  I have run into an issue and I'm not sure if it's a bug or if i'm not understanding how Civi is using the Financial Accounts.
  
  I have created a new account relationship called "Fund" in the option groups.
  I created a Financial Account called "General Fund" as an Asset (EQUITY) account type.
  I attempted to assign the Financial Account "General Fund" with a relationship of Fund to the Financial Type Donation. Civi just sits and spins when I click on assign account and never actually adds the account to the Financial Type.
  
  The reason I'm doing this is so that an extension that I'm having written can pull that info from Civi to import into my accounting software.
  
  Edit: I was able to replicate this on my site and the demo.
  
  I'm running 4.7.11 and Drupal 7. The demo is running 4.7.13
  
  **EDIT** I checked the database just to see if there was something different with the financial type and account that I created. I did notice that in the civicrm\_option\_value table that the row for the account relationship I created the column component\_id was blank and all the others were set to 2. I changed the one I entered to 2 (it didn't make a difference).
  
  I tried adding the account to the type manually in the database and it shows up in the UI. I can't edit it through the UI but it's there.
  
  **Tags:** issues, accounting, financial-types, financial-accounts
  
  > **Comments:**
  > **username_1**: I replicated this on dmaster and got following: Sorry but we are not able to provide this at the moment. This financial account cannot have 'PD test' relationship.  
  > **username_2**: I reported this as https://issues.civicrm.org/jira/browse/CRM-19739 .  
  > **username_1**: I have assigned the above to one of our team to do as part of our community effort.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2017-07-13. Score: 4
  
  This was due to the exception thrown on an AJAX pop. A fix has been raised for it at <https://github.com/civicrm/civicrm-core/pull/10651>.
  
  Hopefully it will be a part of 4.7.23 release.
  
  
  ---
  
  ### Answer by username_2 on 2016-12-09. Score: 0
  
  I am afraid that CiviCRM on this side is less flexible as it seems. Here is a fragment of the file FinancialAccount.php Line 282. 
  $Links = array(
    'Expense Account is' => 'Expenses',
    'Accounts Receivable Account is' => 'Asset',
    'Income Account is' => 'Revenue',
    'Asset Account is' => 'Asset',
    'Cost of Sales Account is' => 'Cost of Sales',
    'Premiums Inventory Account is' => 'Asset',
    'Discounts Account is' => 'Revenue',
    'Sales Tax Account is' => 'Liability',
    'Deferred Revenue Account is' => 'Liability',
    'Refunds to' => 'Liability',
  );
  
  It shows that the code makes strong assumptions about the defined account relationships. You can add your custom account relationship in this place, and you then you can use the screen to connect it to financial types. But I think it is safer to figure out how your extension can work within the existing financial schemes.
  
  
  ---
  
  