Deal with line items that have no account
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 28 Nov 2018 14:51:59 +0000 (09:51 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 28 Nov 2018 14:51:59 +0000 (09:51 -0500)
These are not renewals so they won't have an account.

index.php
views/admin/billing/invoiceStore.html

index 5263c2c..60634cf 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.16
+ * Version: 1.0.17
  * 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.16
+ * @version 1.0.17
  */
 
 /*
@@ -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.16');
+define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.17');
 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 ee08d4c..e53c433 100644 (file)
@@ -85,8 +85,13 @@ body {
                 <tbody>
                     {foreach $line_items as $item}
                     <tr>
-                        <td align="left" width="150">{$item.account.ref_name}</td>
-                        <td align="left" width="40">{$item.account.anniversary_date|date_format:"%m/%d/%y"}</td>
+                        {if isset($item.account) && $item.account == "0"}
+                            <td align="left" width="150">N/A</td>
+                            <td align="left" width="40">N/A</td>
+                        {else}
+                            <td align="left" width="150">{$item.account.ref_name}</td>
+                            <td align="left" width="40">{$item.account.anniversary_date|date_format:"%m/%d/%y"}</td>
+                        {/if}
                         <td align="right" width="10">&nbsp;</td>
                         <td align="left" width="300">{$item.name}</td>
                         <td align="right" width="60">${$item.amount|string_format:"%.2f"}</td>