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

Extend support for financial_types into various tables

    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

      This issue extends support for financial types and thus financial accounts into areas where it was previously needed but missing. It covers configuring financial_type_id values but for the most part not dealing with them during the creation or updating of transactional information.

      Add a financial_type_id field to the appropriate files in xml/schema:
      civicrm_price_field_value (Revenue)
      civicrm_line_item (Revenue)
      civicrm_grant (Expense)
      civicrm_contribution_recur (Revenue)
      civicrm_premiums_products (Expense)
      civicrm_contribution_product (Expense)
      civicrm_product (Expense)

      Make a validation that will return errors if there is no entity_financial_account.relationship of the types in the parentheses above for the financial_type selected.

      Create upgrade scripts to alter the tables so that the fields allow Null. Joe to spec the choice of financial_type_id to put into each field. After the fields are updated with values, change the fields to required / not null.

      Change the UI for the fields as follows (required field in all cases except for grant sometimes - see details below):
      civicrm_price_field_value:

      • Put column between Default and Order on civicrm/admin/price/field/option?action=browse.
      • Put field between Description and Participants Count on civicrm/admin/price/field/option?reset=1&action=update
      • Default value of new price_field_value.financial_type_id to the session's most recent price_field_value.financial_type_id
        civicrm_price_field
      • Put column between Field Type and Order on civicrm/admin/price/field?action=browse
      • Put field between Display Amount and Order on civicrm/admin/price/field?action=update
      • Default to - select -

      civicrm_line_item

      • No UI. Fill with value from related price_field_value record.

      civicrm_grant

      • Between Money Transferred and Grant Report Due on civicrm/grant/add
      • only required if there is non-null date for Money Transferred and non-zero Amount Granted
      • Andrew to specify how to record this

      civicrm_contribution_recur

      • No UI: pull from contribution_page.financial_type_id at time recurring contribution is set up.

      civicrm_product

      • Put field between Actual Cost of Product and Options on civicrm/admin/contribute/managePremiums?action=update. This is a default value for the financial_type for how to handle it when it is included in premiums for a page.

      civicrm_premiums_products

      • Put a financial_type field between Select the Product and Weight on civicrm/admin/contribute/addProductToPage?action=update&id=1&pid=1&reset=1
        • As the 'Select a Product' field is changed, the financial_type will be updated to show a default value of the related civicrm_product. This default value can be changed to a different financial_type.
      • Put a column between Min Contribution and Weight on civicrm/admin/contribute/premium?action=update&reset=1&id=1

      civicrm_contribution_product

      • No UI: pull from civicrm_premiums_products at time of contribution.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days, 7 hours
                4d 7h