jenkins-bot has submitted this change and it was merged.

Change subject: Exclude refunded donations in 'latest' calculation
......................................................................


Exclude refunded donations in 'latest' calculation

No need to filter in the lifetime total because refunded donations
should each have a matching negative refund.

Bug: T117931
Change-Id: I42b7361f0106bb783d6921b591fdabed252ba865
---
M silverpop_export/update_table.sql
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Eileen: Looks good to me, but someone else must approve
  Awight: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/silverpop_export/update_table.sql 
b/silverpop_export/update_table.sql
index 9ca18df..af4619e 100755
--- a/silverpop_export/update_table.sql
+++ b/silverpop_export/update_table.sql
@@ -83,7 +83,9 @@
     civicrm.wmf_contribution_extra ex
   WHERE
     e.contact_id = ct.contact_id AND
-    ex.entity_id = ct.id
+    ex.entity_id = ct.id AND
+    ct.total_amount > 0 AND -- Refunds don't count
+    ct.contribution_status_id = 1 -- 'Completed'
   GROUP BY
     e.email
   HAVING

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I42b7361f0106bb783d6921b591fdabed252ba865
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Eileen <emcnaugh...@wikimedia.org>
Gerrit-Reviewer: Springle <sprin...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to