diff --git a/app/Http/Controllers/Report/BalanceController.php b/app/Http/Controllers/Report/BalanceController.php index 63fada0b43..5c46b25b57 100644 --- a/app/Http/Controllers/Report/BalanceController.php +++ b/app/Http/Controllers/Report/BalanceController.php @@ -140,7 +140,7 @@ final class BalanceController extends Controller } catch (Throwable $e) { Log::error(sprintf('Could not render reports.partials.balance: %s', $e->getMessage())); Log::error($e->getTraceAsString()); - $result = 'Could not render view.'; + $result = sprintf('Could not render view: %s', $e->getMessage()); throw new FireflyException($result, 0, $e); } diff --git a/resources/views/reports/partials/balance.blade.php b/resources/views/reports/partials/balance.blade.php index 87e87714e3..daf4146091 100644 --- a/resources/views/reports/partials/balance.blade.php +++ b/resources/views/reports/partials/balance.blade.php @@ -3,44 +3,44 @@ {{ __('firefly.budgets') }} @foreach($report['accounts'] as $account) - {% if account.sum != 0 %} - {{ $account['name'] }} + @if($account['sum'] !== 0) + {{ $account['name'] }} @endif @endforeach {{ __('firefly.sum') }} - - {% for budget in report.budgets %} - {% if budget.spent|length > 0 %} + @foreach($report['budgets'] as $budget) + @if($budget['spent'] > 0) - {{ budget.budget_name }} + {{ $budget['budget_name'] }} @foreach($report['accounts'] as $account) - {% if budget.spent[$account->id] %} + @if(array_key_exists($account['id'], $budget['spent'])) - {!! format_amount_by_symbol(budget.spent[$account->id].spent, budget.spent[$account->id].currency_symbol, budget.spent[$account->id].currency_decimal_places) }} + {!! format_amount_by_symbol($budget['spent'][$account['id']]['spent'], $budget['spent'][$account['id']]['currency_symbol'], $budget['spent'][$account['id']]['currency_decimal_places']) !!} + data-currency-id="{{ $budget['spent'][$account['id']]['currency_id'] }}" + class="bi bi-info-circle text-muted firefly-info-button"> @else - {% if report.accounts[$account->id].sum != 0 %} + @if($report['accounts'][$account['id']]['sum'] != 0)   @endif @endif @endforeach - {% for sum in report.sums[budget.budget_id] %} - {!! format_amount_by_symbol(sum.sum, sum.currency_symbol, sum.currency_decimal_places) }} + @if(array_key_exists($budget['budget_id'], $report['sums'])) + @foreach($report['sums'][$budget['budget_id']] as $sum) + {!! format_amount_by_symbol($sum['sum'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!}
@endforeach + @endif @endif @@ -50,9 +50,9 @@ {{ __('firefly.sum') }} @foreach($report['accounts'] as $account) - {% if account.sum != 0 %} + @if($account['sum'] !== 0) - {!! format_amount_by_symbol(account.sum, account.currency_symbol, account.currency_decimal_places) }} + {!! format_amount_by_symbol($account['sum'], $account['currency_symbol'], $account['currency_decimal_places']) !!} @endif @endforeach diff --git a/resources/views/reports/partials/bills.blade.php b/resources/views/reports/partials/bills.blade.php index c6b02efd52..9324ac8b86 100644 --- a/resources/views/reports/partials/bills.blade.php +++ b/resources/views/reports/partials/bills.blade.php @@ -48,41 +48,5 @@ @endif @endforeach - - - @foreach($bills->getBills() as $line) - - - {{ $line->getBill()->name }} -
- {{ trans('firefly.bill_expected_between', ['start' => $line->getPayDate()->isoFormat($monthAndDayFormat), 'end' => $line->getEndOfPayDate()->isoFormat($monthAndDayFormat)]) }} -
- - {!! format_amount_by_currency($line->getCurrency(), $line->getMin()) !!} - {!! format_amount_by_currency($line->getCurrency(), $line->getMax()) !!} - - {{-- if bill is hit, show hit amount --}} - @if($line->isHit()) - - - {!! format_amount_by_currency($line->getCurrency(), $line->getAmount()) !!} - - - @endif - {{-- if not but is active, show "not yet charged --}} - @if(!$line->isHit() && $line->isActive()) - {{ __('firefly.notCharged') }} - @endif - @if(!$line->isActive() && !$line->isHit()) -   - @endif - - @if($line->isHit()) - {!! format_amount_by_currency($line->getCurrency(), ($line->getMax() + $line->getAmount())) !!} - @endif - - - - @endforeach diff --git a/resources/views/reports/partials/budgets.blade.php b/resources/views/reports/partials/budgets.blade.php index a015b9f83b..5af3952bfa 100644 --- a/resources/views/reports/partials/budgets.blade.php +++ b/resources/views/reports/partials/budgets.blade.php @@ -3,79 +3,79 @@ {{ __('firefly.budget') }} {{ __('firefly.date') }} - {{ 'budgeted'|_ }} + {{ __('firefly.budgeted') }} {{ trans('list.percentage') }} {{ __('firefly.spent') }} {{ trans('list.percentage') }}   - {{ 'left'|_ }} - {{ 'overspent'|_ }} + {{ __('firefly.left') }} + {{ __('firefly.overspent') }} - {% for budget in report.budgets %} - {% for budget_limit in budget.budget_limits %} + @foreach($report['budgets'] as $budget) + @foreach($budget['budget_limits'] as $budgetLimit) - {% if budget.no_budget %} + @if($budget['no_budget']) - {{ 'no_budget'|_ }} ({{ budget_limit.currency_name }}) + {{ __('firefly.no_budget') }} ({{ $budgetLimit['currency_name'] }}) @else - - {{ budget.budget_name }} + + {{ $budget['budget_name'] }} @endif - - {% if null != budget_limit.budget_limit_id %} - - {{ budget_limit.start_date.isoFormat($monthAndDayFormat) }} + + @if(null !== $budgetLimit['budget_limit_id']) + + {{ $budgetLimit['start_date']->isoFormat($monthAndDayFormat) }} — - {{ budget_limit.end_date.isoFormat($monthAndDayFormat) }} + {{ $budgetLimit['end_date']->isoFormat($monthAndDayFormat) }} @endif - - {% if null != budget_limit.budgeted %} - {!! format_amount_by_symbol(budget_limit.budgeted, budget_limit.currency_symbol, budget_limit.currency_decimal_places) }} + + @if(null !== $budgetLimit['budgeted']) + {!! format_amount_by_symbol($budgetLimit['budgeted'], $budgetLimit['currency_symbol'], $budgetLimit['currency_decimal_places']) !!} @endif - - {{ budget_limit.budgeted_pct }}% + + {{ $budgetLimit['budgeted_pct'] }}% - - {!! format_amount_by_symbol(budget_limit.spent, budget_limit.currency_symbol, budget_limit.currency_decimal_places) }} + + {!! format_amount_by_symbol($budgetLimit['spent'], $budgetLimit['currency_symbol'], $budgetLimit['currency_decimal_places']) !!} - - {{ budget_limit.spent_pct }}% + + {{ $budgetLimit['spent_pct'] }}% - {% if budget_limit.spent != 0 %} - + @if($budgetLimit['spent'] != 0) + @endif - - {% if null != budget_limit.left %} - {!! format_amount_by_symbol(budget_limit.left, budget_limit.currency_symbol, budget_limit.currency_decimal_places) }} + + @if(null !== $budgetLimit['left']) + {!! format_amount_by_symbol($budgetLimit['left'], $budgetLimit['currency_symbol'], $budgetLimit['currency_decimal_places']) !!} @endif - - {% if null != budget_limit.overspent %} - {!! format_amount_by_symbol(budget_limit.overspent, budget_limit.currency_symbol, budget_limit.currency_decimal_places) }} + + @if(null !== $budgetLimit['overspent']) + {!! format_amount_by_symbol($budgetLimit['overspent'], $budgetLimit['currency_symbol'], $budgetLimit['currency_decimal_places']) !!} @endif @@ -83,17 +83,16 @@ @endforeach - {% for sum in report.sums %} + @foreach($report['sums'] as $sum) - {{ __('firefly.sum') }} ({{ sum.currency_name }}) - {!! format_amount_by_symbol(sum.budgeted, sum.currency_symbol, sum.currency_decimal_places) }} + {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) + {!! format_amount_by_symbol($sum['budgeted'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!}   - {!! format_amount_by_symbol(sum.spent, sum.currency_symbol, sum.currency_decimal_places) }} + {!! format_amount_by_symbol($sum['spent'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!}     - {!! format_amount_by_symbol(sum.left, sum.currency_symbol, sum.currency_decimal_places) }} - {!! format_amount_by_symbol(sum.overspent, sum.currency_symbol, sum.currency_decimal_places) }} - + {!! format_amount_by_symbol($sum['left'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} + {!! format_amount_by_symbol($sum['overspent'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} @endforeach diff --git a/resources/views/reports/partials/categories.blade.php b/resources/views/reports/partials/categories.blade.php index 00911d2399..0339401f3f 100644 --- a/resources/views/reports/partials/categories.blade.php +++ b/resources/views/reports/partials/categories.blade.php @@ -9,44 +9,44 @@ - {% for category in report.categories %} + @foreach($report['categories'] as $category) @if($loop->index > $listLength) @else @endif - - {{ category.title }} + + {{ $category['title'] }} - {!! format_amount_by_symbol(category.spent, category.currency_symbol, category.currency_decimal_places, true) }} - {!! format_amount_by_symbol(category.earned, category.currency_symbol, category.currency_decimal_places, true) }} - {!! format_amount_by_symbol(category.sum, category.currency_symbol, category.currency_decimal_places, true) }} + {!! format_amount_by_symbol($category['spent'], $category['currency_symbol'], $category['currency_decimal_places'], true) !!} + {!! format_amount_by_symbol($category['earned'], $category['currency_symbol'], $category['currency_decimal_places'], true) !!} + {!! format_amount_by_symbol($category['sum'], $category['currency_symbol'], $category['currency_decimal_places'], true) !!} - @endforeach - {% if report.categories|length > listLength %} + @if(count($report['categories']) > $listLength) {{ trans('firefly.show_full_list',['number' => $incomeTopLength]) }} @endif - {% for sum in report.sums %} + @foreach($report['sums'] as $sum) - {{ __('firefly.sum') }} ({{ sum.currency_name }}) + {{ __('firefly.sum') }} ({{ $sum['currency_name'] }}) - {!! format_amount_by_symbol(sum.spent, sum.currency_symbol, sum.currency_decimal_places) }} + {!! format_amount_by_symbol($sum['spent'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} - {!! format_amount_by_symbol(sum.earned, sum.currency_symbol, sum.currency_decimal_places) }} + {!! format_amount_by_symbol($sum['earned'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} - {!! format_amount_by_symbol(sum.sum, sum.currency_symbol, sum.currency_decimal_places) }} + {!! format_amount_by_symbol($sum['sum'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!} @endforeach diff --git a/resources/views/transactions/mass/edit.blade.php b/resources/views/transactions/mass/edit.blade.php index 9767c2af81..ed8afa49ac 100644 --- a/resources/views/transactions/mass/edit.blade.php +++ b/resources/views/transactions/mass/edit.blade.php @@ -156,9 +156,9 @@ {% if journal.transaction_type_type == 'Withdrawal' %}