Fixes for the main billing page.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 3 Jan 2019 20:22:00 +0000 (15:22 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 3 Jan 2019 20:22:00 +0000 (15:22 -0500)
For pending data

classes/billingSupport.php
index.php
models/admin/billing/index.php

index 1dd2e09..666e584 100644 (file)
@@ -913,6 +913,9 @@ class GlmBillingSupport
         // This may need to have filters setup in the contact plugin as well.
         // $employees = apply_filters( 'glm_contact_has_employees', '', $member_id );
         $main_billing_account = $this->getAccountByRefDest( $member_id );
+        if ( !$main_billing_account ) {
+            return $accounts;
+        }
         // echo '<pre>$main_billing_account: ' . print_r( $main_billing_account, true ) . '</pre>';
         $Employees = new GlmDataEmployees( $this->wpdb, $this->config );
         $employees = $Employees->getList( "T.account = " . $main_billing_account['id'] );
index 750c91c..3ca41e7 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Members Billing
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: This is glmAssociate Billing Module
- * Version: 1.0.19
+ * Version: 1.0.20
  * Author: Gaslight Media
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -19,7 +19,7 @@
  * @package glmMembersBillingAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.19
+ * @version 1.0.20
  */
 
 /*
@@ -37,7 +37,7 @@
  *  so that we're sure the other add-ons see an up to date
  *  version from this plugin.
  */
-define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.19');
+define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.20');
 define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.26');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index 70cb643..53e5e0c 100644 (file)
@@ -248,8 +248,8 @@ class GlmMembersAdmin_billing_index extends GlmDataAccounts
             $orderBy             = 'renewal_date ASC';
             $curDate             = date( 'Y-m-d' );
             $pendingWhere        = "T.archived <> true AND invoice_type != 0 ";
-            $pendingWhere       .= " AND T.renewal_date + INTERVAL 1 YEAR - INTERVAL $days_before_renewal DAY  < = '$curDate'" ;
-            $pendingWhere       .= " AND T.renewal_date + INTERVAL 1 YEAR + INTERVAL $days_after_expired DAY >   = '$curDate'";
+            $pendingWhere       .= " AND T.renewal_date + INTERVAL 1 YEAR - INTERVAL $days_before_renewal DAY  <= '$curDate'" ;
+            $pendingWhere       .= " AND T.renewal_date + INTERVAL 1 YEAR + INTERVAL $days_after_expired DAY >= '$curDate'";
             $start               = 1;
             $this->postEmployees = true;
             $pending             = $this->getList( $pendingWhere, $orderBy, true, 'id', $start, $limit );