From 46b589655cd518a134649194325374456ec22141 Mon Sep 17 00:00:00 2001 From: David Parker Date: Tue, 9 Jul 2024 15:23:25 -0400 Subject: [PATCH] Fixing non-affiliate orders showing in reports --- adminpages/report-csv.php | 2 ++ adminpages/report.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/adminpages/report-csv.php b/adminpages/report-csv.php index 08b96d2..36cf2ca 100644 --- a/adminpages/report-csv.php +++ b/adminpages/report-csv.php @@ -38,6 +38,8 @@ ON o.id = om.pmpro_membership_order_id AND om.meta_key = 'pmpro_affiliate_paid' WHERE o.affiliate_id <> '' + AND o.affiliate_id IS NOT NULL + AND o.affiliate_id <> 0 AND o.status NOT IN('pending', 'error', 'refunded', 'refund', 'token', 'review')"; diff --git a/adminpages/report.php b/adminpages/report.php index 12ad6f3..f943ed9 100644 --- a/adminpages/report.php +++ b/adminpages/report.php @@ -72,6 +72,8 @@ ON o.id = om.pmpro_membership_order_id AND om.meta_key = 'pmpro_affiliate_paid' WHERE o.affiliate_id <> '' + AND o.affiliate_id IS NOT NULL + AND o.affiliate_id <> 0 AND o.status NOT IN('pending', 'error', 'refunded', 'refund', 'token', 'review')"; if ( $report != "all" ) {