feat: add fullname column to transaction reports and update related templates

This commit is contained in:
Focuslinkstech 2025-04-02 11:29:25 +01:00
parent ad7998ebbf
commit 28541f366c
2 changed files with 24 additions and 11 deletions

View File

@ -157,7 +157,7 @@ switch ($action) {
</div> </div>
<div id="logo"><img id="image" src="' . $logo . '" alt="logo" /></div> <div id="logo"><img id="image" src="' . $logo . '" alt="logo" /></div>
</div> </div>
<div id="header">' . Lang::T('All Transactions at Date') . ': ' . Lang::dateAndTimeFormat($sd, $ts) .' - '. Lang::dateAndTimeFormat($ed, $te) . '</div> <div id="header">' . Lang::T('All Transactions at Date') . ': ' . Lang::dateAndTimeFormat($sd, $ts) . ' - ' . Lang::dateAndTimeFormat($ed, $te) . '</div>
<table id="customers"> <table id="customers">
<tr> <tr>
<th>' . Lang::T('Username') . '</th> <th>' . Lang::T('Username') . '</th>
@ -251,7 +251,7 @@ $style
$html $html
EOF; EOF;
$mpdf->WriteHTML($nhtml); $mpdf->WriteHTML($nhtml);
$mpdf->Output('phpnuxbill_reports_'.date('Ymd_His') . '.pdf', 'D'); $mpdf->Output('phpnuxbill_reports_' . date('Ymd_His') . '.pdf', 'D');
} else { } else {
echo 'No Data'; echo 'No Data';
} }
@ -264,6 +264,10 @@ EOF;
$stype = _post('stype'); $stype = _post('stype');
$d = ORM::for_table('tbl_transactions'); $d = ORM::for_table('tbl_transactions');
$d->left_outer_join('tbl_customers', 'tbl_transactions.username = tbl_customers.username')
->select('tbl_transactions.*')
->select('tbl_customers.fullname', 'fullname')
->order_by_desc('tbl_transactions.id');
if ($stype != '') { if ($stype != '') {
$d->where('type', $stype); $d->where('type', $stype);
} }
@ -296,6 +300,10 @@ EOF;
$tdate = _post('tdate'); $tdate = _post('tdate');
$stype = _post('stype'); $stype = _post('stype');
$d = ORM::for_table('tbl_transactions'); $d = ORM::for_table('tbl_transactions');
$d->left_outer_join('tbl_customers', 'tbl_transactions.username = tbl_customers.username')
->select('tbl_transactions.*')
->select('tbl_customers.fullname', 'fullname')
->order_by_desc('tbl_transactions.id');
if ($stype != '') { if ($stype != '') {
$d->where('type', $stype); $d->where('type', $stype);
} }
@ -338,6 +346,7 @@ EOF;
<table id="customers"> <table id="customers">
<tr> <tr>
<th>' . Lang::T('Username') . '</th> <th>' . Lang::T('Username') . '</th>
<th>' . Lang::T('Fullname') . '</th>
<th>' . Lang::T('Plan Name') . '</th> <th>' . Lang::T('Plan Name') . '</th>
<th>' . Lang::T('Type') . '</th> <th>' . Lang::T('Type') . '</th>
<th>' . Lang::T('Plan Price') . '</th> <th>' . Lang::T('Plan Price') . '</th>
@ -350,6 +359,7 @@ EOF;
foreach ($x as $value) { foreach ($x as $value) {
$username = $value['username']; $username = $value['username'];
$fullname = $value['fullname'];
$plan_name = $value['plan_name']; $plan_name = $value['plan_name'];
$type = $value['type']; $type = $value['type'];
$price = $config['currency_code'] . ' ' . number_format($value['price'], 0, $config['dec_point'], $config['thousands_sep']); $price = $config['currency_code'] . ' ' . number_format($value['price'], 0, $config['dec_point'], $config['thousands_sep']);
@ -361,6 +371,7 @@ EOF;
$html .= "<tr" . (($c = !$c) ? ' class="alt"' : ' class=""') . ">" . " $html .= "<tr" . (($c = !$c) ? ' class="alt"' : ' class=""') . ">" . "
<td>$username</td> <td>$username</td>
<td>$fullname</td>
<td>$plan_name</td> <td>$plan_name</td>
<td>$type</td> <td>$type</td>
<td align='right'>$price</td> <td align='right'>$price</td>

View File

@ -26,6 +26,7 @@
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-bordered table-condensed table-striped " style="background: #ffffff"> <table class="table table-bordered table-condensed table-striped " style="background: #ffffff">
<th class="text-center">{Lang::T('Username')}</th> <th class="text-center">{Lang::T('Username')}</th>
<th class="text-center">{Lang::T('Fullname')}</th>
<th class="text-center">{Lang::T('Plan Name')}</th> <th class="text-center">{Lang::T('Plan Name')}</th>
<th class="text-center">{Lang::T('Type')}</th> <th class="text-center">{Lang::T('Type')}</th>
<th class="text-center">{Lang::T('Plan Price')}</th> <th class="text-center">{Lang::T('Plan Price')}</th>
@ -36,6 +37,7 @@
{foreach $d as $ds} {foreach $d as $ds}
<tr> <tr>
<td>{$ds['username']}</td> <td>{$ds['username']}</td>
<td>{$ds['fullname']}</td>
<td class="text-center">{$ds['plan_name']}</td> <td class="text-center">{$ds['plan_name']}</td>
<td class="text-center">{$ds['type']}</td> <td class="text-center">{$ds['type']}</td>
<td class="text-right">{Lang::moneyFormat($ds['price'])}</td> <td class="text-right">{Lang::moneyFormat($ds['price'])}</td>