Expand views.

This commit is contained in:
James Cole
2026-06-28 17:18:02 +02:00
parent 23dc005d9f
commit 3bb48c587d
26 changed files with 219 additions and 434 deletions
@@ -448,8 +448,10 @@ final class TagController extends Controller
{
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, $tags);
$result = [];
$incomeTopLength = 0;
foreach ($spent as $currency) {
foreach ($currency['tags'] as $tag) {
$incomeTopLength++;
foreach ($tag['transaction_journals'] as $journal) {
$result[] = [
'description' => $journal['description'],
@@ -476,7 +478,7 @@ final class TagController extends Controller
array_multisort($amounts, SORT_ASC, $result);
try {
$result = view('reports.tag.partials.top-expenses', ['result' => $result])->render();
$result = view('reports.tag.partials.top-expenses', ['result' => $result, 'incomeTopLength' => $incomeTopLength])->render();
} catch (Throwable $e) {
Log::debug(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage()));
$result = sprintf('Could not render view: %s', $e->getMessage());