feat: add fullname field to transaction reports and update report template

This commit is contained in:
Focuslinkstech 2025-04-02 11:23:17 +01:00
parent 4c64cfabd2
commit ad7998ebbf
2 changed files with 7 additions and 1 deletions

View File

@ -279,7 +279,7 @@ switch ($action) {
try { try {
$d = Paginator::findMany($query, ['q' => $q]); $d = Paginator::findMany($query, ['q' => $q]);
} catch (Exception $e) { } catch (Exception $e) {
r2(getUrl('reports/activation/'), 'e','Database query failed: ' . $e->getMessage()); r2(getUrl('reports/activation/'), 'e', 'Database query failed: ' . $e->getMessage());
$d = []; $d = [];
} }
@ -302,6 +302,10 @@ switch ($action) {
$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);
} }

View File

@ -37,6 +37,7 @@
<thead> <thead>
<tr> <tr>
<th>{Lang::T('Username')}</th> <th>{Lang::T('Username')}</th>
<th>{Lang::T('Fullname')}</th>
<th>{Lang::T('Type')}</th> <th>{Lang::T('Type')}</th>
<th>{Lang::T('Plan Name')}</th> <th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Plan Price')}</th> <th>{Lang::T('Plan Price')}</th>
@ -50,6 +51,7 @@
{foreach $d as $ds} {foreach $d as $ds}
<tr> <tr>
<td>{$ds['username']}</td> <td>{$ds['username']}</td>
<td>{$ds['fullname']}</td>
<td>{$ds['type']}</td> <td>{$ds['type']}</td>
<td>{$ds['plan_name']}</td> <td>{$ds['plan_name']}</td>
<td class="text-right">{Lang::moneyFormat($ds['price'])}</td> <td class="text-right">{Lang::moneyFormat($ds['price'])}</td>