Update how to get ref_dest from employees.
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 4 Dec 2018 16:00:45 +0000 (11:00 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 4 Dec 2018 16:00:45 +0000 (11:00 -0500)
Already have the ref_dest in the account data. No need to look up by
name.

classes/billingSupport.php
index.php

index 0bcd233..1dd2e09 100644 (file)
@@ -926,14 +926,15 @@ class GlmBillingSupport
                 // echo '<pre>$billing_account: ' . print_r( $billing_account, true ) . '</pre>';
                 // If we don't have an account for this member then one
                 // Needs to be created.
-                $ref_dest = $this->wpdb->get_var(
-                    $this->wpdb->prepare(
-                        "SELECT id
-                           FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "members
-                          WHERE name = %s",
-                        $emp['employee_name']
-                    )
-                );
+                // $ref_dest = $this->wpdb->get_var(
+                //     $this->wpdb->prepare(
+                //         "SELECT id
+                //            FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "members
+                //           WHERE name = %s",
+                //         $emp['employee_name']
+                //     )
+                // );
+                $ref_dest = $billing_account['ref_dest'];
                 // echo '<pre>$ref_dest: ' . print_r( $ref_dest, true ) . '</pre>';
                 if ( !$billing_account ) {
                     // Get the Member Name
index 60634cf..4c26673 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.17
+ * Version: 1.0.18
  * 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.17
+ * @version 1.0.18
  */
 
 /*
@@ -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.17');
+define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.18');
 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.