Update list invoices to show total invoice count.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 16 Mar 2018 16:17:47 +0000 (12:17 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 16 Mar 2018 16:17:47 +0000 (12:17 -0400)
Adding stats to list invoice pages.

models/admin/billing/index.php
models/admin/billing/invoices.php
views/admin/billing/invoices.html

index 454f327..f4cf7ba 100644 (file)
@@ -124,6 +124,7 @@ class GlmMembersAdmin_billing_index extends GlmDataInvoices
         $accounts           = false;
         $haveInvoices       = false;
         $filterAccounts     = '';
+        $totalInvoices      = false;
 
         // For lockedToMember
         $lockedToMember = false;
@@ -340,6 +341,7 @@ class GlmMembersAdmin_billing_index extends GlmDataInvoices
             $this->line_items_post = true;
             $invoicesResult = $this->getList($where, $orderBy, true, 'id', $start, $limit);
             // echo '<pre>$invoicesResult: ' . print_r( $invoicesResult, true ) . '</pre>';
+            $totalInvoices = $this->getStats();
             $this->line_items_post = false;
 
             // Get paging results
@@ -399,6 +401,7 @@ class GlmMembersAdmin_billing_index extends GlmDataInvoices
             'haveInvoices'       => $haveInvoices,
             'accounts'           => $accounts,
             'filterAccounts'     => $filterAccounts,
+            'totalInvoices'      => $totalInvoices,
         );
         // echo '<pre>$templateData: ' . print_r( $templateData, true ) . '</pre>';
 
index 2756f5e..e48b1a1 100644 (file)
@@ -126,6 +126,7 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices
         $invoices           = false;
         $fromMemberMenu     = false;
         $filterAccounts     = '';
+        $totalInvoices      = false;
 
         // Get any provided option
         if (isset($_REQUEST['option'])) {
@@ -418,6 +419,7 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices
             $this->line_items_post = true;
             $invoicesResult = $this->getList($where, $orderBy, true, 'id', $start, $limit);
             // echo '<pre>$invoicesResult: ' . print_r( $invoicesResult, true ) . '</pre>';
+            $totalInvoices = $this->getStats();
             $this->line_items_post = false;
 
             // Get paging results
@@ -477,6 +479,7 @@ class GlmMembersAdmin_billing_invoices extends GlmDataInvoices
             'toDate'              => $toDate,
             'fromMemberMenu'      => $fromMemberMenu,
             'filterAccounts'      => $filterAccounts,
+            'totalInvoices'       => $totalInvoices,
         );
 
         // Return status, any suggested view, and any data to controller
index baba9d1..2b5c93c 100644 (file)
         </div>
         <br clear="all">
 
+        <p>Total found: {$totalInvoices}</p>
+
     {if $paging}
         <input type="Submit" name="pageSelect" value="Previous {$limit} Invoices" class="button button-secondary glm-button"{if !$prevStart} disabled{/if}>
         <input type="Submit" name="pageSelect" value="Next {$limit} Invoices" class="button button-secondary glm-button"{if !$nextStart} disabled{/if}>
     {/if}
         <br clear="all">
 
+
 <table class="wp-list-table widefat fixed posts glm-admin-table">
     <thead>
         <tr>