*/
public function entryPostProcessing($r, $a)
{
- $r['member_name'] = $this->wpdb->get_var(
+ $member_data = $this->wpdb->get_row(
$this->wpdb->prepare(
- "SELECT A.ref_name
+ "SELECT A.ref_name,A.ref_dest
FROM " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "invoices I
LEFT OUTER JOIN " . GLM_MEMBERS_BILLING_PLUGIN_DB_PREFIX . "accounts A ON ( I.account = A.id )
WHERE I.id = %d",
$r['id']
- )
+ ),
+ ARRAY_A
);
+ if ( isset( $member_data ) && $member_data['ref_name'] ) {
+ $r['member_name'] = $member_data['ref_name'];
+ }
+ if ( isset( $member_data ) && $member_data['ref_dest'] ) {
+ $r['member_id'] = $member_data['ref_dest'];
+ }
if ( $this->line_items_post ) {
// Get line items for each invoice
$Billing = new GlmBillingSupport( $this->wpdb, $this->config );
// since we're doing paging, we have to break out just the invoices data
$invoices = $invoicesResult['list'];
+ // echo '<pre>$invoices: ' . print_r( $invoices, true ) . '</pre>';
if (count($invoices)>0) {
$haveInvoices = true;
}
<tr class="alternate">
{/if}
<td> {$t.id} </td>
- <td> {$t.member_name} </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}