0

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.

3
  • 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.
    – petednz - fuzion
    Dec 5, 2016 at 0:07
  • I reported this as issues.civicrm.org/jira/browse/CRM-19739 . Dec 9, 2016 at 11:35
  • I have assigned the above to one of our team to do as part of our community effort.
    – petednz - fuzion
    Jul 7, 2017 at 19:35

2 Answers 2

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.