Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.0
-
Fix Version/s: 4.3.0
-
Component/s: Accounting Integration, CiviContribute
-
Labels:
Description
Financial item(s) associated with a contribution need to be deleted when contribution is deleted. We are already deleting all other associated records (line_item, financial_trxn, entity_financial_trxn).
In review the CiviAccount Data Flow (), looks like financial_item rows may be linked (via entity_table / entity_id) to EITHER a line_item or financial_trxn. Given that, one reasonable approach would be to add the DELETE financial_item query to these two existing functions:
CRM_Core_BAO_FinancialTrxn::deleteFinancialTrxn
- delete FROM civicrm_financial_item where entity_table = 'civicrm_financial_trxn' and entity_id = $thisFinancialTrxn
CRM_Price_BAO_LineItem::deleteLineItems
- delete FROM civicrm_financial_item where entity_table = 'civicrm_line_item' and entity_id = $thisLineItem
Also added check for orphaned financial rows to 4.3 upgrade (beta5) in postUpgradeMessage function. Gives user heads-up if there are orphaned records and points to wiki page w/ details and cleanup queries.
— original post —
When a contribution is deleted, the records in civicrm_contribution and civicrm_line_item are deleted. However, the associated record in civicrm_financial_item is not deleted and remains orphaned.
This is at odds with the warning message displayed when you are about to delete a contribution, which says: "Deleting this contribution will result in the loss of the associated financial transactions (if any)."
Applies to CiviCRM 4.3 beta 3.
Attachments
Issue Links
- provides patch for
-
CRM-12156 Cannot permanently delete a contact for whom a contribution has been created
- Done/Fixed