-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Add Colum Description on My Invoice Pages #37
Comments
@bakhtiyarsierad What if invoice is not only for one domain/service ? |
This solution is not ideal, but it can be a good start for customizing your system. <thead>
<tr>
<th>{lang key='invoicestitle'}</th>
<th>{lang key='navservices'}</th>
<th>{lang key='invoicesdatecreated'}</th>
<th>{lang key='invoicesdatedue'}</th>
<th>{lang key='invoicestotal'}</th>
<th>{lang key='invoicesstatus'}</th>
</tr>
</thead>
<tbody>
{foreach $invoices as $index => $invoice}
<tr onclick="clickableSafeRedirect(event, 'viewinvoice.php?id={$invoice.id}', false)">
<td>{$invoice.invoicenum}</td>
<td>{$cstmInvoices[$index]}</td>
<td><span class="w-hidden">{$invoice.normalisedDateCreated}</span>{$invoice.datecreated}</td>
<td><span class="w-hidden">{$invoice.normalisedDateDue}</span>{$invoice.datedue}</td>
<td data-order="{$invoice.totalnum}">{$invoice.total}</td>
<td><span class="label status status-{$invoice.statusClass}">{$invoice.status}</span></td>
</tr>
{/foreach}
</tbody> And for hook <?php
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
use WHMCS\Database\Capsule;
function cstmAddDescToInvoice($vars)
{
$cstmInvoices = [];
foreach ($vars['invoices'] as $index => $invoice) {
$domains = Capsule::table('tblinvoiceitems')
->where('invoiceid', $invoice['id'])
->where('type', 'hosting')
->join('tblhosting', 'tblhosting.id', '=', 'tblinvoiceitems.relid')
->pluck('domain')
->toArray(); // for whmcs8+
$cstmInvoices[$index] = implode(' – ', array_filter($domains));
}
return ['cstmInvoices' => $cstmInvoices];
}
add_hook("ClientAreaPageInvoices", 1, "cstmAddDescToInvoice"); I do not recommend using this code in production, this is just an example. Test on your development for edge cases. |
Describe the solution you'd like
Hello, may be you can help, in pages My Invoice on client area. May be can added one coloum to describe about the service, only inform can get from domain service or service name.
Thank's
The text was updated successfully, but these errors were encountered: