Update order by and list for dashboard
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 20 Mar 2018 18:00:35 +0000 (14:00 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 20 Mar 2018 18:00:35 +0000 (14:00 -0400)
Updating the doashboard list to match the invoice order by.

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

index 3d555cc..cf2e0c7 100644 (file)
@@ -127,6 +127,7 @@ class GlmMembersAdmin_billing_index extends GlmDataInvoices
         $totalInvoices      = false;
         $filterPending      = false;
         $filterOverdue      = false;
+        $invoices           = false;
 
         // For lockedToMember
         $lockedToMember = false;
@@ -233,10 +234,13 @@ class GlmMembersAdmin_billing_index extends GlmDataInvoices
             $view = 'editAccount';
             break;
         case 'list':
+            $orderBy = 'due_date ASC, transaction_time DESC';
             // // Get list of pending invoices ( not overdue )
             $pendingWhere = 'T.paid <> true AND T.due_date > now()';
             $start        = 1;
-            $pending      = $this->getList( $pendingWhere, 'transaction_time', true, 'id', $start, $limit );
+            $this->line_items_post = true;
+            $pending      = $this->getList( $pendingWhere, $orderBy, true, 'id', $start, $limit );
+            $this->line_items_post = false;
             // /**
             //  * $pending = array( start, limit, returned, last, list = array...)
             //  */
@@ -245,7 +249,9 @@ class GlmMembersAdmin_billing_index extends GlmDataInvoices
             // // Get the number of over due invoices
             $overDueWhere  = 'T.paid <> true AND T.due_date < now()';
             $start         = 1;
-            $overdue       = $this->getList( $overDueWhere, 'transaction_time', true, 'id', $start, $limit );
+            $this->line_items_post = true;
+            $overdue       = $this->getList( $overDueWhere, $orderBy, true, 'id', $start, $limit );
+            $this->line_items_post = false;
             if ( isset( $overdue['returned'] ) ) {
                 $numberOverdue = $overdue['returned'];
             }
index 33061d5..acaf732 100644 (file)
     <thead>
         <tr>
             <th style="width: 50px;">ID</th>
-            <th>Member Name</th>
-            <th>Time</th>
-            <th>Due Date</th>
-            <th>Balance</th>
-            <th>View</th>
+            <th style="width: 150px;">Member Name</th>
+            <th>Invoice For</th>
+            <th style="width: 150px;">Time</th>
+            <th style="width: 70px;">Due Date</th>
+            <th style="width: 100px;">Amount Total</th>
+            <th style="width: 70px;">Balance</th>
+            <th style="width: 50px;">View</th>
         </tr>
     </thead>
     <tbody>
                 {/if}
                     <td> {$t.id} </td>
                     <td> <a href="{$adminUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$t.member_id}">{$t.member_name}</a> </td>
+                    <td>
+                    {foreach $t.line_items as $item}
+                        {$item.name} {if $item.recurring && $item.recurrence_string}( {$item.recurrence_string} ){/if}
+                    {/foreach}
+                    </td>
                     <td> {$t.transaction_time.datetime} </td>
                     <td> {$t.due_date.date} </td>
+                    <td> {$t.amount_total} </td>
                     <td> {$t.balance} </td>
                     <td> <a href="{$thisUrl}?page=glm-members-admin-menu-billing&glm_action=invoices&option=view&id={$t.id}">View</a> </td>
                 </tr>
     <thead>
         <tr>
             <th style="width: 50px;">ID</th>
-            <th>Member Name</th>
-            <th>Time</th>
-            <th>Due Date</th>
-            <th>Balance</th>
-            <th>View</th>
+            <th style="width: 150px;">Member Name</th>
+            <th>Invoice For</th>
+            <th style="width: 150px;">Time</th>
+            <th style="width: 70px;">Due Date</th>
+            <th style="width: 100px;">Amount Total</th>
+            <th style="width: 70px;">Balance</th>
+            <th style="width: 50px;">View</th>
         </tr>
     </thead>
     <tbody>
                 {/if}
                     <td> {$t.id} </td>
                     <td> <a href="{$adminUrl}?page=glm-members-admin-menu-member&glm_action=billing&member={$t.member_id}">{$t.member_name}</a> </td>
+                    <td>
+                    {foreach $t.line_items as $item}
+                        {$item.name} {if $item.recurring && $item.recurrence_string}( {$item.recurrence_string} ){/if}
+                    {/foreach}
+                    </td>
                     <td> {$t.transaction_time.datetime} </td>
                     <td> {$t.due_date.date} </td>
+                    <td> {$t.amount_total} </td>
                     <td> {$t.balance} </td>
                     <td> <a href="{$thisUrl}?page=glm-members-admin-menu-billing&glm_action=invoices&option=view&id={$t.id}">View</a> </td>
                 </tr>
index 1c66114..302ec93 100644 (file)
@@ -52,7 +52,7 @@
     <thead>
         <tr>
             <th style="width: 50px;">ID</th>
-            <th>Member Name</th>
+            <th style="width: 150px;">Member Name</th>
             <th>Invoice For</th>
             <th style="width: 150px;">Time</th>
             <th style="width: 70px;">Due Date</th>