From: Steve Sutton Date: Tue, 20 Mar 2018 18:00:35 +0000 (-0400) Subject: Update order by and list for dashboard X-Git-Tag: v1.0.0^2~114 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=757647ab266c1076e2f353425d8c2c8dc1cf4817;p=WP-Plugins%2Fglm-member-db-billing.git Update order by and list for dashboard Updating the doashboard list to match the invoice order by. --- diff --git a/models/admin/billing/index.php b/models/admin/billing/index.php index 3d555cc..cf2e0c7 100644 --- a/models/admin/billing/index.php +++ b/models/admin/billing/index.php @@ -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']; } diff --git a/views/admin/billing/index.html b/views/admin/billing/index.html index 33061d5..acaf732 100644 --- a/views/admin/billing/index.html +++ b/views/admin/billing/index.html @@ -55,11 +55,13 @@ ID - Member Name - Time - Due Date - Balance - View + Member Name + Invoice For + Time + Due Date + Amount Total + Balance + View @@ -73,8 +75,14 @@ {/if} {$t.id} {$t.member_name} + + {foreach $t.line_items as $item} + {$item.name} {if $item.recurring && $item.recurrence_string}( {$item.recurrence_string} ){/if} + {/foreach} + {$t.transaction_time.datetime} {$t.due_date.date} + {$t.amount_total} {$t.balance} View @@ -91,11 +99,13 @@ ID - Member Name - Time - Due Date - Balance - View + Member Name + Invoice For + Time + Due Date + Amount Total + Balance + View @@ -109,8 +119,14 @@ {/if} {$t.id} {$t.member_name} + + {foreach $t.line_items as $item} + {$item.name} {if $item.recurring && $item.recurrence_string}( {$item.recurrence_string} ){/if} + {/foreach} + {$t.transaction_time.datetime} {$t.due_date.date} + {$t.amount_total} {$t.balance} View diff --git a/views/admin/billing/invoices.html b/views/admin/billing/invoices.html index 1c66114..302ec93 100644 --- a/views/admin/billing/invoices.html +++ b/views/admin/billing/invoices.html @@ -52,7 +52,7 @@ ID - Member Name + Member Name Invoice For Time Due Date