Adding in the line items.
$type = $transaction['type'];
switch ( $type ){
case $this->config['transaction_numb']['Invoice']:
- $invoice = $this->getInvoiceById( $transaction['type_id'] );
+ $invoice = $this->getInvoiceById( $transaction['type_id'] );
+ $line_items = $this->getLineItemsForInvoice( $transaction['type_id'] );
$balance_due = $balance_due + $invoice['amount_total'];
// add to the $transaction array
$transaction['transaction_data'] = $invoice;
+ $transaction['line_items'] = $line_items;
break;
case $this->config['transaction_numb']['Payment']:
$payment = $this->getPaymentById( $transaction['type_id'] );
// Remove what we don't want from the copy and get the list
$this->fields = array(
- 'id' => $fSave['id'],
- 'name' => $fSave['ref_name'],
+ 'id' => $fSave['id'],
+ 'name' => $fSave['ref_name'],
+ 'anniversary_date' => $fSave['anniversary_date'],
);
$memberList = $this->getList($where, $order, $fieldVals, $idField, $start, $limit);
$orderBy = 'transaction_time desc';
$this->line_items_post = true;
$invoicesResult = $this->getList($where, $orderBy, true, 'id', $start, $limit);
- echo '<pre>$invoicesResult: ' . print_r( $invoicesResult, true ) . '</pre>';
+ // echo '<pre>$invoicesResult: ' . print_r( $invoicesResult, true ) . '</pre>';
$this->line_items_post = false;
// Get paging results
// Need to get the accounts
$Accounts = new GlmDataAccounts( $this->wpdb, $this->config );
$billingAccount = $Accounts->newEntry();
- $accounts = $Accounts->getList( '', 'ref_name' );
+ $accounts = $Accounts->getSimpleAccountList( '', 'ref_name' );
// Need a list of members that don't have an account.
$nonAccountMembers = $this->wpdb->get_results(
// Need to get the accounts
$Accounts = new GlmDataAccounts( $this->wpdb, $this->config );
$billingAccount = $Accounts->newEntry();
- $accounts = $Accounts->getList( '', 'ref_name' );
+ $accounts = $Accounts->getSimpleAccountList( '', 'ref_name' );
// Need a list of members that don't have an account.
$nonAccountMembers = $this->wpdb->get_results(
// Need to get the accounts
$Accounts = new GlmDataAccounts( $this->wpdb, $this->config );
- $accounts = $Accounts->getList();
+ $accounts = $Accounts->getSimpleAccountList();
$where_params = array( 'true' );
$orderBy = 'transaction_time desc';
$this->line_items_post = true;
$invoicesResult = $this->getList($where, $orderBy, true, 'id', $start, $limit);
- echo '<pre>$invoicesResult: ' . print_r( $invoicesResult, true ) . '</pre>';
+ // echo '<pre>$invoicesResult: ' . print_r( $invoicesResult, true ) . '</pre>';
$this->line_items_post = false;
// Get paging results
$view = 'statements';
// Get the list of invoices for this member.
$statements = $BillingSupport->getStatementsByRefDest( $this->memberID );
+ // echo '<pre>$statements: ' . print_r( $statements, true ) . '</pre>';
if ( $statements ) {
$transactions = $statements['transactions'];
$account_data = $statements['account_data'];
<tr>
<th style="width: 50px;">ID</th>
<th>Member Name</th>
- <th>Time</th>
- <th>Due Date</th>
- <th>Amount Total</th>
- <th>Balance</th>
- <th>View</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> {$t.member_name} </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>
<table class="glm-admin-table wp-list-table widefat">
<thead>
<tr>
- <th>ID</th>
+ <th style="width:50px;">ID</th>
<th>Date</th>
<th>Due Date</th>
<th>Type</th>
+ <th>Line Items (invoices only)</th>
<th>Amount</th>
<th>Balance</th>
<th> </th>
<tbody>
{$alt = 0}
{foreach $transactions as $transaction}
- <tr{if $alt % 2 == 0} class="alternate"{/if}>
+ {* Invoices *}
{if $transaction.type == '10'}
- <td>{$transaction.transaction_data.id}</td>
- <td>{$transaction.transaction_data.transaction_time|date_format:"%D"}</td>
- <td>{$transaction.transaction_data.due_date|date_format:"%D"}</td>
- <td>{$transaction_types[$transaction.type]}</td>
- <td>${$transaction.transaction_data.amount_total}</td>
- <td>${$transaction.transaction_data.balance}</td>
- <td> <a href="{$thisUrl}?page={$thisPage}&glm_action=billing&option=view&member={$memberID}&id={$transaction.type_id}">View</a> </td>
+ <tr{if $alt % 2 == 0} class="alternate"{/if}>
+ <td>{$transaction.transaction_data.id}</td>
+ <td>{$transaction.transaction_data.transaction_time|date_format:"%D"}</td>
+ <td>{$transaction.transaction_data.due_date|date_format:"%D"}</td>
+ <td>{$transaction_types[$transaction.type]}</td>
+ <td>
+ {foreach $transaction.line_items as $item}
+ {$item.name} {if $item.recurring && $item.recurrence_string}( {$item.recurrence_string} ){/if}<br>
+ {/foreach}
+ </td>
+ <td>${$transaction.transaction_data.amount_total}</td>
+ <td>${$transaction.transaction_data.balance}</td>
+ <td> <a href="{$thisUrl}?page={$thisPage}&glm_action=billing&option=view&member={$memberID}&id={$transaction.type_id}">View</a> </td>
+ </tr>
+ {* Payments *}
{elseif $transaction.type == '20'}
- <td>{$transaction.transaction_data.id}</td>
- <td>{$transaction.transaction_data.transaction_time|date_format:"%D"}</td>
- <td> </td>
- <td>{$transaction_types[$transaction.type]}</td>
- <td>${$transaction.transaction_data.amount}</td>
- <td> </td>
- <td> </td>
+ <tr{if $alt % 2 == 0} class="alternate"{/if}>
+ <td>{$transaction.transaction_data.id}</td>
+ <td>{$transaction.transaction_data.transaction_time|date_format:"%D"}</td>
+ <td> </td>
+ <td>{$transaction_types[$transaction.type]}</td>
+ <td> </td>
+ <td>${$transaction.transaction_data.amount}</td>
+ <td> </td>
+ <td> </td>
+ </tr>
{/if}
- </tr>
{$alt = $alt + 1}
{/foreach}
</tr>
<tr>
- <th style="text-align: right;" colspan="2">Due Date</th>
+ <th colspan="2">Due Date</th>
</tr>
<tr>
</td>
</tr>
<tr>
- <th class="glm-required">Amount:Numbers only (999.99)</th>
+ <th class="glm-required">Amount:Numbers only<br> (999.99)</th>
<td>
<input type="text" name="amount" class="glm-form-text-input" required>
</td>
</td>
</tr>
<tr>
- <th style="text-align: right;" class="glm-required">Amount:Numbers only (999.99)</th>
+ <th style="text-align: right;" class="glm-required">Amount:Numbers only<br> (999.99)</th>
<td>
<input id="edit-amount" type="text" name="amount" class="glm-form-text-input" required>
</td>
<table class="wp-list-table widefat fixed posts glm-admin-table">
<thead>
<tr>
- <th>ID</th>
- <th>InvoiceType</th>
+ <th style="width: 50px;">ID</th>
+ <th style="width: 850px;">InvoiceType</th>
<th>Amount</th>
<th>Recurring</th>
<th>Recurrence</th>