From: Steve Sutton Date: Thu, 3 Jan 2019 20:22:00 +0000 (-0500) Subject: Fixes for the main billing page. X-Git-Tag: v1.0.20^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=719e449cdc96a42a45840fc13fbc938b216e5756;p=WP-Plugins%2Fglm-member-db-billing.git Fixes for the main billing page. For pending data --- diff --git a/classes/billingSupport.php b/classes/billingSupport.php index 1dd2e09..666e584 100644 --- a/classes/billingSupport.php +++ b/classes/billingSupport.php @@ -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 '
$main_billing_account: ' . print_r( $main_billing_account, true ) . '
'; $Employees = new GlmDataEmployees( $this->wpdb, $this->config ); $employees = $Employees->getList( "T.account = " . $main_billing_account['id'] ); diff --git a/index.php b/index.php index 750c91c..3ca41e7 100644 --- 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 * @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. diff --git a/models/admin/billing/index.php b/models/admin/billing/index.php index 70cb643..53e5e0c 100644 --- a/models/admin/billing/index.php +++ b/models/admin/billing/index.php @@ -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 );