$where = implode( ' AND ', $where_params );
// Get the list of invoices and determine number of invoices in list
- $orderBy = 'due_date ASC, transaction_time DESC';
+ $orderBy = 'due_date DESC, transaction_time DESC';
$this->line_items_post = true;
$invoicesResult = $this->getList($where, $orderBy, true, 'id', $start, $limit);
$totalInvoices = $this->getStats($where);
)
);
$BillingSupport->recordInvoice( $invoiceId, $accountId, $amount );
- $invoiceSuccess = true;
+ $invoiceSuccess = $invoiceId;
}
} else {
$invoiceError = true;
{if $invoiceSuccess}
<p>
- Invoice is Created. <a href="{$thisUrl}?page={$thisPage}&glm_action=billing&member={$memberID}">View Invoice</a>
+ Invoice is Created.
+ {if $settings.invoice_pdf_enabled}
+ <a target="_blank" href="{$ajaxUrl}?action=glm_members_admin_ajax&glm_action=createPDFInvoice&id={$invoiceSuccess}">Print Invoice</a>
+ {else}
+ <a href="{$thisUrl}?page={$thisPage}&glm_action=billing&option=view&member={$memberID}&id={$invoiceSuccess}">View Invoice</a>
+ {/if}
</p>
{else}