From c276268a9359d78fd3bedbf246a4b324c3c1cc1b Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 27 Jun 2026 12:33:34 +0200 Subject: [PATCH] Expand views. --- .../Controllers/Report/BudgetController.php | 4 +- .../Report/Partial/JournalsAudit.php | 32 ++++ public/v1/js/ff/reports/audit/all.js | 1 + .../accounts/reconcile/transactions.blade.php | 4 +- .../views/components/lists/accounts.blade.php | 8 +- .../views/components/lists/periods.blade.php | 12 +- .../lists/piggy-bank-events.blade.php | 2 +- .../components/lists/subscriptions.blade.php | 24 +-- .../report/partial/journals-audit.blade.php | 169 ++++++++++++++++++ resources/views/layout/v3/session.blade.php | 34 ++-- resources/views/list/accounts.blade.php | 8 +- resources/views/list/bills.blade.php | 30 ++-- resources/views/list/groups.blade.php | 4 +- resources/views/list/periods.blade.php | 12 +- .../views/list/piggy-bank-events.blade.php | 2 +- resources/views/list/piggy-banks.blade.php | 6 +- .../views/partials/menu-sidebar.blade.php | 6 +- resources/views/piggy-banks/index.blade.php | 4 +- resources/views/popup/list/journals.blade.php | 2 +- resources/views/profile/index.blade.php | 4 +- resources/views/recurring/show.blade.php | 2 +- .../views/reports/audit/report.blade.php | 50 +++--- .../views/reports/budget/month.blade.php | 94 +++++----- .../partials/account-per-budget.blade.php | 22 +-- .../budget/partials/accounts.blade.php | 24 +-- .../budget/partials/avg-expenses.blade.php | 32 ++-- .../reports/budget/partials/budgets.blade.php | 34 ++-- .../budget/partials/top-expenses.blade.php | 36 ++-- .../views/reports/category/month.blade.php | 24 +-- .../partials/account-per-category.blade.php | 6 +- .../category/partials/accounts.blade.php | 22 +-- .../category/partials/avg-expenses.blade.php | 12 +- .../category/partials/avg-income.blade.php | 12 +- .../category/partials/categories.blade.php | 28 +-- .../category/partials/top-expenses.blade.php | 10 +- .../category/partials/top-income.blade.php | 10 +- .../views/reports/default/month.blade.php | 22 +-- .../reports/default/multi-year.blade.php | 14 +- .../views/reports/default/year.blade.php | 14 +- .../partials/accounts-per-asset.blade.php | 22 +-- .../double/partials/accounts.blade.php | 22 +-- .../double/partials/avg-expenses.blade.php | 12 +- .../double/partials/avg-income.blade.php | 12 +- .../double/partials/top-expenses.blade.php | 8 +- .../double/partials/top-income.blade.php | 8 +- .../views/reports/double/report.blade.php | 16 +- .../views/reports/options/budget.blade.php | 6 +- .../views/reports/options/category.blade.php | 6 +- .../views/reports/options/double.blade.php | 6 +- .../reports/options/no-options.blade.php | 2 +- resources/views/reports/options/tag.blade.php | 11 +- .../views/reports/partials/accounts.blade.php | 12 +- .../views/reports/partials/balance.blade.php | 12 +- .../views/reports/partials/bills.blade.php | 6 +- .../reports/partials/budget-period.blade.php | 14 +- .../views/reports/partials/budgets.blade.php | 20 +-- .../reports/partials/categories.blade.php | 20 +-- .../partials/category-period.blade.php | 12 +- .../partials/exp-not-grouped.blade.php | 2 +- .../partials/income-expenses.blade.php | 10 +- .../reports/partials/journals-audit.blade.php | 2 +- .../partials/top-transactions.blade.php | 8 +- resources/views/reports/tag/month.blade.php | 24 +-- .../tag/partials/account-per-tag.blade.php | 6 +- .../reports/tag/partials/accounts.blade.php | 22 +-- .../tag/partials/avg-expenses.blade.php | 12 +- .../reports/tag/partials/avg-income.blade.php | 12 +- .../views/reports/tag/partials/tags.blade.php | 28 +-- .../tag/partials/top-expenses.blade.php | 10 +- .../reports/tag/partials/top-income.blade.php | 10 +- .../views/transactions/old-index.blade.php | 2 +- 71 files changed, 713 insertions(+), 498 deletions(-) create mode 100644 app/View/Components/Report/Partial/JournalsAudit.php create mode 100644 resources/views/components/report/partial/journals-audit.blade.php diff --git a/app/Http/Controllers/Report/BudgetController.php b/app/Http/Controllers/Report/BudgetController.php index b766250253..5296011487 100644 --- a/app/Http/Controllers/Report/BudgetController.php +++ b/app/Http/Controllers/Report/BudgetController.php @@ -354,6 +354,7 @@ final class BudgetController extends Controller public function topExpenses(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end) { $spent = $this->opsRepository->listExpenses($start, $end, $accounts, $budgets); + $incomeTopLength = 0; $result = []; foreach ($spent as $currency) { foreach ($currency['budgets'] as $budget) { @@ -375,6 +376,7 @@ final class BudgetController extends Controller 'budget_name' => $budget['name'], ]; } + $incomeTopLength++; } } // sort by amount_float @@ -383,7 +385,7 @@ final class BudgetController extends Controller array_multisort($amounts, SORT_ASC, $result); try { - $result = view('reports.budget.partials.top-expenses', ['result' => $result])->render(); + $result = view('reports.budget.partials.top-expenses', ['result' => $result, 'incomeTopLength'=>$incomeTopLength])->render(); } catch (Throwable $e) { Log::error(sprintf('Could not render reports.partials.budget-period: %s', $e->getMessage())); $result = sprintf('Could not render view: %s', $e->getMessage()); diff --git a/app/View/Components/Report/Partial/JournalsAudit.php b/app/View/Components/Report/Partial/JournalsAudit.php new file mode 100644 index 0000000000..668e57e8cd --- /dev/null +++ b/app/View/Components/Report/Partial/JournalsAudit.php @@ -0,0 +1,32 @@ +journals = $journals; + $this->auditData = $auditData; + $this->account = $account; + } + + /** + * Get the view / contents that represent the component. + */ + public function render(): View|Closure|string + { + return view('components.report.partial.journals-audit'); + } +} diff --git a/public/v1/js/ff/reports/audit/all.js b/public/v1/js/ff/reports/audit/all.js index e52c7a4941..d9d2865611 100644 --- a/public/v1/js/ff/reports/audit/all.js +++ b/public/v1/js/ff/reports/audit/all.js @@ -48,6 +48,7 @@ $(function () { function clickColumnOption() { "use strict"; + console.log('clickColumnOption'); var newArr = readCheckboxes(); showOnlyColumns(newArr); storeCheckboxes(newArr); diff --git a/resources/views/accounts/reconcile/transactions.blade.php b/resources/views/accounts/reconcile/transactions.blade.php index 40f543c2e3..4187f76b73 100644 --- a/resources/views/accounts/reconcile/transactions.blade.php +++ b/resources/views/accounts/reconcile/transactions.blade.php @@ -3,7 +3,7 @@   {{ trans('list.description') }} - {{ trans('list.amount') }} + {{ trans('list.amount') }} {{ trans('list.reconcile') }} {{ trans('list.date') }} {{ trans('list.from') }} @@ -87,7 +87,7 @@ {{ $journal['description'] }} - + {!! format_amount_by_symbol($journal['amount'], $journal['currency_symbol'], $journal['currency_decimal_places']) !!} @if(null !== $journal['foreign_amount']) diff --git a/resources/views/components/lists/accounts.blade.php b/resources/views/components/lists/accounts.blade.php index e53954e7a9..8c455a6657 100644 --- a/resources/views/components/lists/accounts.blade.php +++ b/resources/views/components/lists/accounts.blade.php @@ -17,10 +17,10 @@ @endif {{ trans('form.account_number') }} @if('liabilities' !== $objectType) - {{ trans('list.currentBalance') }} + {{ trans('list.currentBalance') }} @endif @if('liabilities' === $objectType) - + {{ trans('firefly.left_in_debt') }} @endif @@ -65,7 +65,7 @@ @endif {{ $account->iban }} @if('' === $account->iban) {{ account_get_meta_field($account, 'account_number') }}@endif @if('liabilities' !== $objectType) - + @foreach($account->endBalances as $key => $balance) @@ -86,7 +86,7 @@ @endif @if('liabilities' === $objectType) - + @if('' !== $account->current_debt) {!! format_amount_by_symbol($account->current_debt, $account->currency->symbol, $account->currency->decimal_places, false) !!} diff --git a/resources/views/components/lists/periods.blade.php b/resources/views/components/lists/periods.blade.php index 40a945ea71..2957f1c6a6 100644 --- a/resources/views/components/lists/periods.blade.php +++ b/resources/views/components/lists/periods.blade.php @@ -9,7 +9,7 @@ @if($period['total_transactions'] > 0) {{ __('firefly.transactions') }} - {{ $period['total_transactions'] }} + {{ $period['total_transactions'] }} @endif @if(array_key_exists('spent', $period)) @@ -17,7 +17,7 @@ @if(is_array($spent) && $spent['amount'] !== 0) {{ __('firefly.spent') }} - + {!! format_amount_by_symbol($spent['amount'], $spent['currency_symbol'], $spent['currency_decimal_places']) !!} @@ -31,7 +31,7 @@ @if(is_array($entry) && $entry['amount'] !== 0) {{ __('firefly.earned') }} - + @if($entry['amount'] < 0) {!! format_amount_by_symbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) !!} @@ -48,7 +48,7 @@ @if(is_array($entry) && $entry['amount'] !== 0) {{ __('firefly.transferred') }} - + {!! format_amount_by_symbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) !!} @@ -61,7 +61,7 @@ @if(is_array($entry) && $entry['amount'] !== 0) {{ __('firefly.transferred_away') }} - + @if($entry['amount'] < 0) {!! format_amount_by_symbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) !!} @@ -78,7 +78,7 @@ @if($entry['amount'] !== 0) {{ __('firefly.transferred_in') }} - + @if($entry['amount'] < 0) {!! format_amount_by_symbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) !!} diff --git a/resources/views/components/lists/piggy-bank-events.blade.php b/resources/views/components/lists/piggy-bank-events.blade.php index 053bbd02b0..2f98206ca0 100644 --- a/resources/views/components/lists/piggy-bank-events.blade.php +++ b/resources/views/components/lists/piggy-bank-events.blade.php @@ -21,7 +21,7 @@ @endif - + @if($event->amount < 0) {{ trans('firefly.removed_amount', ['amount' => format_amount_by_symbol($event->amount,$event->piggyBank->transactionCurrency->symbol, $event->piggyBank->transactionCurrency->decimal_places, false)]) }} @else diff --git a/resources/views/components/lists/subscriptions.blade.php b/resources/views/components/lists/subscriptions.blade.php index 74138ad337..65080ea62c 100644 --- a/resources/views/components/lists/subscriptions.blade.php +++ b/resources/views/components/lists/subscriptions.blade.php @@ -8,7 +8,7 @@   {{ __('list.name') }} {{ __('list.linked_to_rules') }} - {{ trans('list.matchingAmount') }} + {{ trans('list.matchingAmount') }} {{ trans('list.paid_current_period') }} {{ trans('list.next_expected_match') }} {{ trans('list.repeat_freq') }} @@ -53,7 +53,7 @@ @endif - + ~ {!! format_amount_by_symbol(($entry['amount_max'] + $entry['amount_min'])/2, $entry['currency_symbol'], $entry['currency_decimal_places']) !!} @@ -161,10 +161,10 @@ @if('0' !== $sum['avg'])   - + {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) ({{ __('firefly.active_exp_bills_only') }}) - + {!! format_amount_by_symbol($sum['avg'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!}   @@ -173,10 +173,10 @@ @if('0' !== $sum['total_left_to_pay'])   - + {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) ({{ __('firefly.left_to_pay_active_bills') }}) - + {!! format_amount_by_symbol($sum['total_left_to_pay'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!}   @@ -185,11 +185,11 @@ @if('0' !== $sum['per_period'])   - + {{ __('firefly.per_period_sum_' . $sum['period']) }} ({{ $sum['currency_name'] }}) ({{ __('firefly.active_bills_only') }}) - + {!! format_amount_by_symbol($sum['per_period'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!}   @@ -211,21 +211,21 @@ @foreach($totals as $sum) @if('0' !== $sum['avg']) - + {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) ({{ __('firefly.active_exp_bills_only_total') }}) - + {!! format_amount_by_symbol($sum['avg'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} @endif @if('0' !== $sum['per_period']) - + {{ __('firefly.per_period_sum_' . $sum['period']) }} ({{ $sum['currency_name'] }}) ({{ __('firefly.active_bills_only_total') }}) - + {!! format_amount_by_symbol($sum['per_period'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} diff --git a/resources/views/components/report/partial/journals-audit.blade.php b/resources/views/components/report/partial/journals-audit.blade.php new file mode 100644 index 0000000000..a1de513c25 --- /dev/null +++ b/resources/views/components/report/partial/journals-audit.blade.php @@ -0,0 +1,169 @@ + + + + + + + + + + + + + {{-- new optional fields (3x) --}} + + + + + + + + {{-- more optional fields (2x) --}} + + + + + + {{-- even more optional fields --}} + + + + + + + + + + + @foreach($journals as $journal) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @endforeach + + +
  {{ trans('list.description') }}{{ trans('list.balance_before') }}{{ trans('list.amount') }}{{ trans('list.balance_after') }}{{ trans('list.date') }}{{ trans('list.from') }}{{ trans('list.to') }}{{ trans('list.bill') }}{{ trans('list.create_date') }}{{ trans('list.update_date') }}{{ trans('list.notes') }}{{ trans('list.interest_date') }}{{ trans('list.book_date') }}{{ trans('list.process_date') }}{{ trans('list.due_date') }}{{ trans('list.payment_date') }}{{ trans('list.invoice_date') }}
+
+ + +
+
+ + + + @if(strlen($journal['group_title']) > 0) + {{ $journal['group_title'] }} ({{ $journal['description'] }}) + @else + {{ $journal['description'] }} + @endif + + + {!! format_amount_by_symbol($journal['balance_before'], $auditData[$account->id]['currency']->symbol, $auditData[$account->id]['currency']->decimal_places) !!} + + + @if($auditData[$account->id]['currency']->id == $journal['currency_id']) + @if($account->id == $journal['destination_account_id'] and $journal['transaction_type_type'] == 'Opening balance') + {!! format_amount_by_symbol($journal['amount']*-1, $journal['currency_symbol'], $journal['currency_decimal_places']) !!} + @elseif($account->id == $journal['destination_account_id'] and $journal['transaction_type_type'] == 'Deposit') + {!! format_amount_by_symbol($journal['amount']*-1, $journal['currency_symbol'], $journal['currency_decimal_places']) !!} + @elseif($account->id == $journal['destination_account_id'] and $journal['transaction_type_type'] == 'Transfer') + {!! format_amount_by_symbol($journal['amount']*-1, $journal['currency_symbol'], $journal['currency_decimal_places']) !!} + @else + {!! format_amount_by_symbol($journal['amount'], $journal['currency_symbol'], $journal['currency_decimal_places']) !!} + @endif + @endif + + @if($auditData[$account->id]['currency']->id == $journal['foreign_currency_id']) + @if($account->id == $journal['destination_account_id'] and $journal['transaction_type_type'] == 'Opening balance') + {!! format_amount_by_symbol($journal['foreign_amount']*-1, $journal['foreign_currency_symbol'], $journal['foreign_currency_decimal_places']) !!} + @elseif($account->id == $journal['destination_account_id'] and $journal['transaction_type_type'] == 'Deposit') + {!! format_amount_by_symbol($journal['foreign_amount']*-1, $journal['foreign_currency_symbol'], $journal['foreign_currency_decimal_places']) !!} + @elseif($account->id == $journal['destination_account_id'] and $journal['transaction_type_type'] == 'Transfer') + {!! format_amount_by_symbol($journal['foreign_amount']*-1, $journal['foreign_currency_symbol'], $journal['foreign_currency_decimal_places']) !!} + @else + {!! format_amount_by_symbol($journal['foreign_amount'], $journal['foreign_currency_symbol'], $journal['foreign_currency_decimal_places']) !!} + @endif + @endif + + {!! format_amount_by_symbol($journal['balance_after'], $auditData[$account->id]['currency']->symbol, $auditData[$account->id]['currency']->decimal_places) !!} + {{ $journal['date']->isoFormat($monthAndDayFormat) }} + {{ $journal['source_account_name'] }} + + {{ $journal['destination_account_name'] }} + + @if(null !== $journal['budget_id']) + {{ $journal['budget_name'] }} + @endif + + @if(null !== $journal['category_id']) + {{ $journal['category_name'] }} + @endif + + @if(null !== $journal['bill_id']) + {{ $journal['bill_name'] }} + @endif + + {{ $journal['created_at']->isoFormat($dateTimeFormat) }} + + {{ $journal['updated_at']->isoFormat($dateTimeFormat) }} + + {{ parse_markdown($journal['notes'] ?? '') }} + + @if(null !== $journal['interest_date']) + {{ $journal['interest_date']->isoFormat($monthAndDayFormat) }} + @endif + + @if(null !== $journal['book_date']) + {{ $journal['book_date']->isoFormat($monthAndDayFormat) }} + @endif + + @if(null !== $journal['process_date']) + {{ $journal['process_date']->isoFormat($monthAndDayFormat) }} + @endif + + @if(null !== $journal['due_date']) + {{ $journal['due_date']->isoFormat($monthAndDayFormat) }} + @endif + + @if(null !== $journal['payment_date']) + {{ $journal['payment_date']->isoFormat($monthAndDayFormat) }} + @endif + + @if(null !== $journal['invoice_date']) + {{ $journal['invoice_date']->isoFormat($monthAndDayFormat) }} + @endif +
diff --git a/resources/views/layout/v3/session.blade.php b/resources/views/layout/v3/session.blade.php index 5220680f95..e02b3e97e4 100644 --- a/resources/views/layout/v3/session.blade.php +++ b/resources/views/layout/v3/session.blade.php @@ -25,7 +25,6 @@ @endif Firefly III - + +
@@ -134,7 +136,6 @@ -
+ + +
- {{ Breadcrumbs::render() }} + @sectionMissing('breadcrumbs') + {{ Breadcrumbs::render() }} + @endif + @yield('breadcrumbs') +
@@ -292,13 +302,13 @@
@if($IS_DEMO_SITE) -
-
- @endif @yield('content') -
+