Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.4.4
-
Fix Version/s: 4.5
-
Component/s: Accounting Integration, CiviContribute, CiviCRM API, CiviEvent, CiviMember
-
Labels:None
-
Documentation Required?:Developer Doc
Description
This issue deals with technical debt of not having easy reporting for link between line items and contributions, and taking advantage of the cleanup to remove a couple of tables no longer needed.
This cleanup is one issue of several involved in creating a new "thick" contribution API above the table oriented ones that will include calls to create all the memberships and participants in a priceset as well as looking after all the related financial stuff. Spec for it is still being developed by Eileen, core team and me in forums, Jira irc and emails.
First step is: add a new field, contribution_id to xml/schema for line item table for tarball and upgrade, that points to the line item's contribution. Currently it is possible to join several table to get it, eg contribution, financial_trxn, entity_financial_trxn, financial_item, line item (I can't recall if you need an entity_financial_item too in there). We need to change the create line item BAO so it fills this field, which may involve changes going up the BAO call stack until the contribution_id is available (needs to be investigated). Refactor tests to check this field too. Then we need to create upgrade code to fill this field for 4.5.
*EDIT* I have edited this ticket so we can close it at this point. membership_payment & participant_payment tables are now redundant - will create separate ticket
Next, we want to remove the membership_payment table and participant_payment tables as they will no longer be needed. This will require 1) changing the xml/schema for tarball, 2) put drop statements into upgrade code, 3) refactoring the sql in a number of files across the codebase, eg reports, 4) fixing tests for 2 & 3.
We will change the 'semantics' of the line_item.entity_table and line_item.entity_id for memberships so that it points to the civicrm_membership table and id for memberships rather than civicrm_contribution and id as it does now.
The semantics / content of line_item.entity_table and entity_id will remain the same for ticket purchases: civicrm_participant and id. For clarity: there is and should be a one-to-one relationship between records in civicrm_line_item and civicrm_participant for ticket purchases, which is not quite the same as each line item representing a single attendee because a 'participant' record can represents more than one real-life participant (eg a table).
Attachments
Issue Links
- has patch in
-
CRM-14894 Membership renewals throw fatal error on unique index UI_line_item_value
- Done/Fixed
- is supplemented by
-
CRM-14918 Line Items should be created for all Membership Signup/Renewal and Participant Registration transactions
- Done/Fixed
- provides patch for
-
CRM-14069 Allow setting event price set ids by api
- Done/Fixed