Eileen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/271186

Change subject: Follow up on adding missing Refund financial trxns
......................................................................

Follow up on adding missing Refund financial trxns

It seems once more row is required & the fix for CRM-17951 exposed.

Bug: T122946
Change-Id: I1f9dddd4ccd1cbf80376682bf9ba352937964e84
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/86/271186/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index d7cea85..c3b7719 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -1817,3 +1817,26 @@
   CRM_Core_DAO::executeQuery("UPDATE civicrm_financial_item SET 
financial_account_id = $cashFinancialAccountID WHERE financial_account_id IS 
NULL");
 
 }
+
+/**
+ * Further refund financial data fix.
+ *
+ * This is an extra record that was missing in 7070. It was obvious until the 
patch for
+ * CRM-17951 was merged:
+ *
+ * CRM-17951 (merged into 4.7) modify transaction view to show the financial 
account of the transaction
+ */
+function wmf_civicrm_update_7160() {
+  civicrm_initialize();
+  CRM_Core_DAO::executeQuery("
+    INSERT INTO civicrm_entity_financial_trxn
+    (entity_table, entity_id, financial_trxn_id, amount)
+    SELECT  'civicrm_financial_item' as entity_table, fi.id as entity_id, 
cont_ft.financial_trxn_id  as financial_trxn_id, fi.amount
+    FROM civicrm_financial_item fi
+    LEFT JOIN civicrm_entity_financial_trxn ft  ON ft.entity_id = fi.id AND 
ft.entity_table = 'civicrm_financial_item'
+    LEFT JOIN civicrm_line_item li ON li.id = fi.entity_id AND fi.entity_table 
= 'civicrm_line_item'
+    LEFT JOIN civicrm_contribution c ON c.id = li.contribution_id
+    LEFT JOIN civicrm_entity_financial_trxn cont_ft ON cont_ft.entity_id = 
c.id AND cont_ft.entity_table = 'civicrm_contribution'
+    WHERE ft.id IS NULL AND fi.created_date > '2016-02-01'
+  ");
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/271186
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f9dddd4ccd1cbf80376682bf9ba352937964e84
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen <emcnaugh...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to