Don't update member contact for billing with 0 as invoice type
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 6 Jun 2018 18:07:42 +0000 (14:07 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 6 Jun 2018 18:07:42 +0000 (14:07 -0400)
invoice_type 0 is for free membership.

models/admin/ajax/billingFlagExpiredUsers.php

index 9bfb69d..2fa73f9 100644 (file)
@@ -83,7 +83,8 @@ class GlmMembersAdmin_ajax_billingFlagExpiredUsers
             $members = $this->wpdb->get_results(
                 "SELECT ref_dest
                    FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "accounts
-                  WHERE renewal_date + INTERVAL 1 YEAR + INTERVAL $days_after_expired DAY <= '$current_date'",
+                  WHERE renewal_date + INTERVAL 1 YEAR + INTERVAL $days_after_expired DAY <= '$current_date'
+                    AND invoice_type != 0",
                    ARRAY_A
             );
             if ( isset( $members ) && $members ) {
@@ -106,6 +107,7 @@ class GlmMembersAdmin_ajax_billingFlagExpiredUsers
                         SELECT ref_dest
                           FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "accounts
                          WHERE renewal_date + INTERVAL 1 YEAR + INTERVAL $days_after_expired DAY <= '$current_date'
+                           AND invoice_type != 0
                         )
                     AND contact_role <> " . $restrictedRole
             );