From: Steve Sutton Date: Fri, 21 Sep 2018 20:44:16 +0000 (-0400) Subject: Show quick links and employees in tho dashboard and account list. X-Git-Tag: v1.0.12^2~1^2~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=982a84d02d125bcfda696c83e286d6698e8b88a1;p=WP-Plugins%2Fglm-member-db-billing.git Show quick links and employees in tho dashboard and account list. Billing list of accounts, show quick links for: Member Dashboard View Statements Billing Info View Employees (if boss flag is set for account) --- diff --git a/classes/data/dataAccounts.php b/classes/data/dataAccounts.php index f5f47e6..825125a 100644 --- a/classes/data/dataAccounts.php +++ b/classes/data/dataAccounts.php @@ -77,6 +77,10 @@ class GlmDataAccounts extends GlmDataAbstract * In the Post Processing get the next_anniversary_date. */ public $postNextAnniversaryDate = false; + /** + * In the Post Processing get the employees + */ + public $postEmployees = false; /** * Constructor @@ -348,6 +352,14 @@ class GlmDataAccounts extends GlmDataAbstract } } } + + if ( $this->postEmployees ) { + include_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH.'/billingSupport.php'; + $BillingSupport = new GlmBillingSupport( $this->wpdb, $this->config ); + $employees = $BillingSupport->getListOfAccountEmployees( $r['ref_dest'] ); + $r['employees'] = $employees; + } + return $r; } diff --git a/css/admin.css b/css/admin.css index aee9833..bde9f9f 100644 --- a/css/admin.css +++ b/css/admin.css @@ -147,3 +147,12 @@ width: 100%; } } + +/* Account list */ +.glm-admin-table a.account-link { + text-decoration: underline; +} +.glm-admin-table span.account-dashboard-link a{ + text-decoration: underline; + font-size: 12px; +} diff --git a/models/admin/billing/accounts.php b/models/admin/billing/accounts.php index 3eb0fb8..f98cca0 100644 --- a/models/admin/billing/accounts.php +++ b/models/admin/billing/accounts.php @@ -424,9 +424,11 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts $where = implode( ' AND ', $where_params ); // Get the list of accounts and determine number of accounts in list - $orderBy = 'renewal_date ASC'; - $accountsResult = $this->getList( $where, $orderBy, true, 'id', $start, $limit ); - $totalAccounts = $this->getStats( $where ); + $orderBy = 'renewal_date ASC'; + $this->postEmployees = true; + $accountsResult = $this->getList( $where, $orderBy, true, 'id', $start, $limit ); + $this->postEmployees = false; + $totalAccounts = $this->getStats( $where ); // Get paging results $numbDisplayed = $accountsResult['returned']; @@ -481,7 +483,6 @@ class GlmMembersAdmin_billing_accounts extends GlmDataAccounts 'limit' => $limit, 'invoiceTypeJSON' => $invoiceTypeJSON, 'invoiceTypes' => $invoiceTypes, - 'accounts' => $accounts, 'invoiceHtml' => $invoiceHtml, 'fromDate' => $fromDate, 'toDate' => $toDate, diff --git a/models/admin/billing/index.php b/models/admin/billing/index.php index 28d7f8c..70cb643 100644 --- a/models/admin/billing/index.php +++ b/models/admin/billing/index.php @@ -245,21 +245,25 @@ class GlmMembersAdmin_billing_index extends GlmDataAccounts // Get list of pending invoices ( not overdue ) $days_before_renewal = $this->config['settings']['days_before_renewal']; $days_after_expired = $this->config['settings']['days_after_expired']; - $orderBy = 'renewal_date ASC'; - $curDate = date( 'Y-m-d' ); - $pendingWhere = "T.archived <> true AND invoice_type != 0 "; - $pendingWhere .= " AND T.renewal_date + INTERVAL 1 YEAR - INTERVAL $days_before_renewal DAY <= '$curDate'" ; - $pendingWhere .= " AND T.renewal_date + INTERVAL 1 YEAR + INTERVAL $days_after_expired DAY >= '$curDate'"; - $start = 1; - $pending = $this->getList( $pendingWhere, $orderBy, true, 'id', $start, $limit ); + $orderBy = 'renewal_date ASC'; + $curDate = date( 'Y-m-d' ); + $pendingWhere = "T.archived <> true AND invoice_type != 0 "; + $pendingWhere .= " AND T.renewal_date + INTERVAL 1 YEAR - INTERVAL $days_before_renewal DAY < = '$curDate'" ; + $pendingWhere .= " AND T.renewal_date + INTERVAL 1 YEAR + INTERVAL $days_after_expired DAY > = '$curDate'"; + $start = 1; + $this->postEmployees = true; + $pending = $this->getList( $pendingWhere, $orderBy, true, 'id', $start, $limit ); + $this->postEmployees = false; // echo '
$pending: ' . print_r( $pending, true ) . '
'; $numberPending = ( isset( $pending['returned'] ) ? $pending['returned'] : 0 ); // Get the number of over due invoices - $overDueWhere = "T.archived <> true AND invoice_type != 0"; - $overDueWhere .= " AND T.renewal_date + INTERVAL 1 YEAR < '$curDate'"; - $start = 1; - $overdue = $this->getList( $overDueWhere, $orderBy, true, 'id', $start, $limit ); + $overDueWhere = "T.archived <> true AND invoice_type != 0"; + $overDueWhere .= " AND T.renewal_date + INTERVAL 1 YEAR < '$curDate'"; + $start = 1; + $this->postEmployees = true; + $overdue = $this->getList( $overDueWhere, $orderBy, true, 'id', $start, $limit ); + $this->postEmployees = false; if ( isset( $overdue['returned'] ) ) { $numberOverdue = $overdue['returned']; } diff --git a/views/admin/billing/accounts.html b/views/admin/billing/accounts.html index 7c6496f..7e10b5c 100644 --- a/views/admin/billing/accounts.html +++ b/views/admin/billing/accounts.html @@ -15,37 +15,70 @@ {/if}
- - - - - - - - - - - - {if $haveAccounts} - {assign var="i" value="0"} - {foreach $accounts as $t} - {if $i++ is odd by 1} - - {else} - - {/if} - - - - - - - {/foreach} - {else} - - {/if} - -
IDMember NameBilling EmailAnniversary DateRenewal Date
{$t.id} {$t.ref_name} {$t.email} {$t.anniversary_date.date} {$t.renewal_date.date}
(no Invoice Types listed)
+
+ + + + + + + + + + + + {if $haveAccounts} + {foreach $accounts as $t} + + + + + + + + + + + {if $t.boss.value} + + + + {/if} + {/foreach} + {else} + + {/if} + +
IDMember NameBilling EmailAnniversary DateRenewal Date
(no Invoice Types listed)
+
{if $paging} @@ -57,5 +90,53 @@ {include file='admin/billing/exportBillingModal.html'} + {include file='admin/footer.html'} diff --git a/views/admin/billing/index.html b/views/admin/billing/index.html index 24aeece..9ceaed1 100644 --- a/views/admin/billing/index.html +++ b/views/admin/billing/index.html @@ -18,39 +18,123 @@
{$dashboard_title}
- - - - - - - - - - - - {if $list.number > 0} - {assign var="i" value="0"} - {foreach $list.data.list as $t} - {if $i++ is odd by 1} - - {else} - - {/if} - - - - - - - {/foreach} - {/if} - -
IDMember NameBilling EmailAnniversary DateRenewal Date
{$t.id} {$t.ref_name} {$t.email} {$t.anniversary_date.date} {$t.renewal_date.date}
+
+ + + + + + + + + + + + {if $list.number > 0} + {foreach $list.data.list as $t} + + + + + + + + + + + {if $t.boss.value} + + + + {/if} + {/foreach} + {/if} + +
IDMember NameBilling EmailAnniversary DateRenewal Date
+

{/foreach} {include file='admin/billing/exportBillingModal.html'} + + {include file='admin/footer.html'}