Details
-
Type: Task
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.0.7
-
Fix Version/s: 4.3.0
-
Component/s: Accounting Integration
-
Labels:None
Description
A new table, civicrm_financial_type, is being introduced. This issue specifies its creation and an administrative interface for it. Its use will be covered elsewhere.
- In xml/schema/Financial/files.xml, add an entry for the new table
- Create xml/schema/Financial/FinancialType.xml by making a copy of xml/schema/Financial/FinancialAccount.xml, with the following changes following v 10.6 SQL Workbench file of the CiviAccounts spec:
- Change the class, name, and add tags as appropriate.
- Retain the following fields and associated keys, and delete the remainder:
- id, name, description, is_deductible, is_reserved, is_active.
- Modify comments as appropriate.
- Add the following fields:
- vid INT(10) NOT NULL Comment 'Version identifier of financial_type.' Also include an index on vid.
- version_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP Comment 'Timestamp when version was created.'
- If necessary, create CRM/Upgrade/Incremental/sql/4.2.alpha1.mysql.tpl.
- Insert into CRM/Upgrade/Incremental/sql/4.2.alpha1.mysql.tpl an appropriate CREATE TABLE statement.
- Create a new menu item, Financial Type, at Administer > CiviContribute, below the section break below Premiums (Thank-you Gifts), just above Contribution Types, pointing to civicrm/admin/finance/financialType?reset=1
- Reproduce the administrative interface for Contribution Types / Financial Accounts as follows, with changes as described below:
- There will be at least one reserved financial_type, so don't bother implementing special code to handle the case of none being available for display.
- The column titles should be the same as for Contribution Types except substituting Financial Accounts for Acctg Code. The links on the left of each row should be Accounts | Edit | Disable | Delete.
- The rows should be sorted ascending on the Name.
- The Financial Accounts column should display a list of civicrm_financial_account.name . ' (Relationship)'
where Relationship is the civicrm_option_value.label for civicrm_option_value.value=civicrm_entity_financial_account.account_relationship and civicrm_entity_financial_account.financial_account_id=civicrm_financial_account.id and entity_table='civicrm_financial_type' and entity_id=civicrm_financial_type.id for that row - As elsewhere in the admin interface, reserved items do not have Disable or Delete links on the right of the row.
- Disable and Delete links operate like similar links in the admin interface.
- The edit link brings up a form similar to civicrm/admin/contribute/contributionType?action=update&id=3&reset=1, with the Accounting Code field removed. There should be a button labelled 'View or Edit Financial Accounts for this Financial Type' similar to the 'View of Edit Fields for this Profile at civicrm/admin/uf/group/update?action=update&id=1&reset=1&context=field
- The Accounts link on each row and the 'View or Edit Financial Accounts for this Financial Type' button on the edit form bring up a form similar to civicrm/admin/uf/group/field?reset=1&action=browse&gid=1 with the following columns containing values from rows in civicrm_financial_account records that have been linked to the financial_type via a civicrm_entity_financial_account record:
- Financial Account (name)
- Relationship (civicrm_entity_financial_account.relationship_id's label)
- Accounting Code (accounting_code)
- Owned By (display_name of contact_id)
- Account Type (lookup of label for financial_account_type_id in civicrm_option_value)
- Is Active?
- More fields may be added later.
- Edit, and Delete links.
- The 'Add Financial Account' and Edit link for an existing listed Financial Account bring up a form that has single select widget for selecting a civicrm_financial_account and a single select widget for selecting civicrm_entity_financial_account.account_relationship. Saving creates or updates the civicrm_entity_financial_account record connecting the selected financial account and the financial type.
- Financial accounts will be created for Campaign Contribution, Donation, Event Fees, and Member Dues. Each will have a default financial account with the same name associated with it using an income / revenue account relationship
- When upgrading, we should create one financial_type for every financial_account/contribution_type that exists in the system, with the same name as the financial account, and add a 'Income Account is' relationship to that existing account
- Create web tests for adding, editting, disabling, and deleting financial_account_type records, and also for adding, editting and deleting the relationships.