Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-9199

Create an admin interface for Financial Type table

    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.

      1. In xml/schema/Financial/files.xml, add an entry for the new table
      2. 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:
        1. Change the class, name, and add tags as appropriate.
        2. Retain the following fields and associated keys, and delete the remainder:
          1. id, name, description, is_deductible, is_reserved, is_active.
          2. Modify comments as appropriate.
        3. Add the following fields:
          1. vid INT(10) NOT NULL Comment 'Version identifier of financial_type.' Also include an index on vid.
          2. version_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP Comment 'Timestamp when version was created.'
      3. If necessary, create CRM/Upgrade/Incremental/sql/4.2.alpha1.mysql.tpl.
      4. Insert into CRM/Upgrade/Incremental/sql/4.2.alpha1.mysql.tpl an appropriate CREATE TABLE statement.
      5. 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
      6. Reproduce the administrative interface for Contribution Types / Financial Accounts as follows, with changes as described below:
        1. 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.
        2. 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.
        3. The rows should be sorted ascending on the Name.
        4. 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
        5. As elsewhere in the admin interface, reserved items do not have Disable or Delete links on the right of the row.
        6. Disable and Delete links operate like similar links in the admin interface.
        7. 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
        8. 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:
          1. Financial Account (name)
          2. Relationship (civicrm_entity_financial_account.relationship_id's label)
          3. Accounting Code (accounting_code)
          4. Owned By (display_name of contact_id)
          5. Account Type (lookup of label for financial_account_type_id in civicrm_option_value)
          6. Is Active?
          7. More fields may be added later.
          8. Edit, and Delete links.
        9. 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.
      7. 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
      8. 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
      9. Create web tests for adding, editting, disabling, and deleting financial_account_type records, and also for adding, editting and deleting the relationships.

        Attachments

          Activity

            People

            • Assignee:
              pradeep.nayak Pradeep Nayak
              Reporter:
              joemurray Joe Murray
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: