Skip to content

Firefly III: a personal finances manager

new view things

Sander Dorigo828d39d51d2c
diff --git a/app/View/Components/Lists/GroupsLarge.php b/app/View/Components/Lists/GroupsLarge.php
index 8592648523..eaa9be33ff 100644
--- a/app/View/Components/Lists/GroupsLarge.php
+++ b/app/View/Components/Lists/GroupsLarge.php
@@ -3,6 +3,7 @@
namespace FireflyIII\View\Components\Lists;
use Closure;
+use FireflyIII\Models\Account;
use Illuminate\Contracts\View\View;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\View\Component;
@@ -10,12 +11,14 @@ use Illuminate\View\Component;
class GroupsLarge extends Component
{
public LengthAwarePaginator $groups;
+ public null|Account $account;
/**
* Create a new component instance.
*/
- public function __construct(LengthAwarePaginator $groups)
+ public function __construct(LengthAwarePaginator $groups, Account|null $account = null)
{
$this->groups = $groups;
+ $this->account = $account;
}
/**
diff --git a/public/v1/js/ff/list/groups.js b/public/v1/js/ff/list/groups.js
index 8e8c3ad8fb..609477bdb4 100644
--- a/public/v1/js/ff/list/groups.js
+++ b/public/v1/js/ff/list/groups.js
@@ -130,7 +130,8 @@ function uncheckAll() {
function updateActionButtons() {
if (0 !== count) {
- $('.action-menu').removeClass('hidden');
+ console.log('show menu');
+ $('.action-menu').removeClass('d-none');
// also update labels:
$('.mass-edit span.txt').text(edit_selected_txt + ' (' + count + ')');
@@ -139,7 +140,7 @@ function updateActionButtons() {
}
if (0 === count) {
- $('.action-menu').addClass('hidden');
+ $('.action-menu').addClass('d-none');
}
}
diff --git a/resources/views/components/lists/groups-large.blade.php b/resources/views/components/lists/groups-large.blade.php
index bb3babe260..354aca36f2 100644
--- a/resources/views/components/lists/groups-large.blade.php
+++ b/resources/views/components/lists/groups-large.blade.php
@@ -1,32 +1,29 @@
-<table class="table table-condensed table-hover table-responsive">
+<table class="table table-condensed table-bordered table-hover table-responsive">
<thead>
<tr>
- @if($showCategory || ($showBudget ?? false))
- <td colspan="7" class="no-margin-pagination">{{ $groups->links('pagination.bootstrap-4') }}</td>
+ @if(($showCategory ?? false) || ($showBudget ?? false))
+ <td colspan="8">{{ $groups->links('pagination.bootstrap-4') }}</td>
@else
- <td colspan="6" class="no-margin-pagination">{{ $groups->links('pagination.bootstrap-4') }}</td>
+ <td colspan="7">{{ $groups->links('pagination.bootstrap-4') }}</td>
@endif
- <td colspan="1" class="d-xs-none">
+ <td class="d-xs-none">
<!-- Single button -->
- <div class="btn-group btn-group-sm action-menu pull-right hidden">
- <button type="button" class="btn btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false">
+ <div class="dropdown action-menu d-none">
+ <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="top_action_menu" data-bs-toggle="dropdown" aria-expanded="false">
{{ __('firefly.actions') }}<span class="caret"></span>
</button>
- <ul class="dropdown-menu dropdown-menu-right">
- <li><a href="#" class="mass-edit"><span class="fa fa-fw fa-pencil"></span>
+ <ul class="dropdown-menu" aria-labelledby="top_action_menu">
+ <li><a href="#" class="dropdown-item mass-edit"><span class="fa fa-fw fa-pencil"></span>
<span class="txt">{{ __('firefly.mass_edit') }}</span></a></li>
- <li><a href="#" class="bulk-edit"><span class="fa fa-fw fa-pencil-square-o"></span>
+ <li><a href="#" class="dropdown-item bulk-edit"><span class="fa fa-fw fa-pencil-square-o"></span>
<span class="txt">{{ __('firefly.bulk_edit') }}</span></a></li>
- <li><a href="#" class="mass-delete"><span class="fa fa-fw fa-trash"></span>
+ <li><a href="#" class="dropdown-item mass-delete"><span class="fa fa-fw fa-trash"></span>
<span class="txt">{{ __('firefly.mass_delete') }}</span></a></li>
</ul>
</div>
</td>
- <td colspan="1" class="d-xs-none">
- <div class="pull-right">
- <input id="list_ALL" value="1" name="select-all" type="checkbox" class="select-all form-check-inline"/>
- </div>
+ <td class="d-xs-none text-end">
+ <input id="list_ALL" value="1" name="select-all" type="checkbox" class="select-all form-check-inline"/>
</td>
</tr>
<tr>
@@ -51,34 +48,34 @@
</thead>
<tbody>
@foreach($groups as $group)
- @if($group->count > 1)
+ @if($group['count'] > 1)
<tr class="top-light-border">
<td colspan="2" class="top-light-border">
<small><strong>
- <a href="{{ route('transactions.show', [$group->id]) }}"
- title="{{ $group->title }}">{{ $group->title }}</a>
+ <a href="{{ route('transactions.show', [$group['id']]) }}"
+ title="{{ $group['title'] }}">{{ $group['title'] }}</a>
</strong></small>
</td>
<td colspan="1" class="text-end top-light-border">
@foreach($group['sums'] as $sum)
@if('Deposit' === $group['transaction_type'])
- {{ formatAmountBySymbol($sum['amount']*-1, $sum['currency_symbol'], $sum['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($sum['amount']*-1, $sum['currency_symbol'], $sum['currency_decimal_places']) !!}
@if($convertToPrimary && 0 !== $sum['pc_amount'])
- (~ {{ formatAmountBySymbol($sum['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($sum['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
@if($loop->index !== count($group['sums'])),@endif
@elseif('Transfer' === $group['transaction_type'])
<span class="text-info money-transfer">
- {{ formatAmountBySymbol($sum['amount']*-1, $sum['currency_symbol'], $sum['currency_decimal_places'], false) }}
+ {!! formatAmountBySymbol($sum['amount']*-1, $sum['currency_symbol'], $sum['currency_decimal_places'], false) !!}
@if($convertToPrimary && 0 !== $sum['pc_amount'])
- (~ {{ formatAmountBySymbol($sum['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($sum['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
@if($loop->index !== count($group['sums'])),@endif
</span>
@else
- {{ formatAmountBySymbol($sum['amount'], $sum['currency_symbol'], $sum['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($sum['amount'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!}
@if($convertToPrimary && 0 !== $sum['pc_amount'])
- (~ {{ formatAmountBySymbol($sum['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($sum['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
@if($loop->index !== count($group['sums'])),@endif
@endif
@@ -96,13 +93,13 @@
aria-haspopup="true" aria-expanded="false">
{{ __('firefly.actions') }} <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
- <li><a href="{{ route('transactions.edit', [$group->id]) }}"><span
+ <li><a href="{{ route('transactions.edit', [$group['id']]) }}"><span
class="fa fa-fw fa-pencil"></span> {{ __('firefly.edit') }}</a></li>
- <li><a href="{{ route('transactions.delete', [$group->id]) }}"><span
+ <li><a href="{{ route('transactions.delete', [$group['id']]) }}"><span
class="fa fa-fw fa-trash"></span> {{ __('firefly.delete') }}</a></li>
- <li><a href="#" data-id="{{ $group->id }}" class="clone-transaction"><span
+ <li><a href="#" data-id="{{ $group['id'] }}" class="clone-transaction"><span
class="fa fa-copy fa-fw"></span> {{ __('firefly.clone') }}</a></li>
- <li><a href="#" data-id="{{ $group->id }}" class="clone-transaction-and-edit"><span
+ <li><a href="#" data-id="{{ $group['id'] }}" class="clone-transaction-and-edit"><span
class="fa fa-copy fa-fw"></span> {{ __('firefly.clone_and_edit') }}</a></li>
</ul>
</div>
@@ -115,7 +112,7 @@
@if(count($group['transactions']) === $loop->index && $group['count'] > 1)
@php $className = 'bottom-light-border'; @endphp
@endif
- <tr data-date="{{ $transaction['date']->format('Y-m-d') }}" data-count="{{ $group['count'] }}" data-id="{{ $group->id }}">
+ <tr data-date="{{ $transaction['date']->format('Y-m-d') }}" data-count="{{ $group['count'] }}" data-id="{{ $group['id'] }}">
<td class="d-xs-none {{ $className }}">
<!-- TODO icon helper -->
@if('Withdrawal' === $transaction['transaction_type_type'])
@@ -152,7 +149,7 @@
<span class="fa fa-paperclip"></span>
@endif
@if(1 === $group['count'])
- <a href="{{ route('transactions.show', [$group->id]) }}" title="{{ $transaction['description'] }}">
+ <a href="{{ route('transactions.show', [$group['id']]) }}" title="{{ $transaction['description'] }}">
@endif
{{ $transaction['description'] }}
@if(1 === $group['count'])
@@ -164,14 +161,14 @@
{{-- deposit --}}
@if('Deposit' === $transaction['transaction_type_type'])
{{-- amount of deposit --}}
- {{ formatAmountBySymbol($transaction['amount']*-1, $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($transaction['amount']*-1, $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}
{{-- foreign amount of deposit --}}
@if(null !== $transaction['foreign_amount'])
- ({{ formatAmountBySymbol($transaction['foreign_amount']*-1, $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) }})
+ ({!! formatAmountBySymbol($transaction['foreign_amount']*-1, $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) !!})
@endif
{{-- primary currency amount of deposit --}}
@if($convertToPrimary && 0 != $transaction['pc_amount'])
- (~ {{ formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
{{-- transfer --}}
@elseif('Transfer' === $transaction['transaction_type_type'])
@@ -179,113 +176,113 @@
<span class="text-info money-transfer">
{{-- present as negative. --}}
@if($transaction['source_account_id'] === $account?->id)
- neg {{ formatAmountBySymbol($transaction['amount'], $transaction['currency_symbol'], $transaction['currency_decimal_places'], false) }}
+ neg {!! formatAmountBySymbol($transaction['amount'], $transaction['currency_symbol'], $transaction['currency_decimal_places'], false) !!}
@endif
{{-- present as positive --}}
@if($transaction['source_account_id'] !== $account?->id)
- {{ formatAmountBySymbol($transaction['amount']*-1, $transaction['currency_symbol'], $transaction['currency_decimal_places'], false) }}
+ {!! formatAmountBySymbol($transaction['amount']*-1, $transaction['currency_symbol'], $transaction['currency_decimal_places'], false) !!}
@endif
{{-- foreign amount of transfer (negative) --}}
@if(null !== $transaction['foreign_amount'] && $transaction['source_account_id'] === $account?->id)
- neg ({{ formatAmountBySymbol($transaction['foreign_amount'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places'], false) }})
+ neg ({!! formatAmountBySymbol($transaction['foreign_amount'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places'], false) !!})
@endif
{{-- foreign amount of transfer (positive) --}}
@if(null !== $transaction['foreign_amount'] && $transaction['source_account_id'] !== $account?->id)
- ({{ formatAmountBySymbol($transaction['foreign_amount']*-1, $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places'], false) }})
+ ({!! formatAmountBySymbol($transaction['foreign_amount']*-1, $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places'], false) !!})
@endif
{{-- transfer in primary currency. Does not care about direction. --}}
@if($convertToPrimary && 0 !== $transaction['pc_amount'])
- (~ {{ formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
</span>
{{-- opening balance --}}
@elseif('Opening balance' === $transaction['transaction_type_type'])
{{-- Is a positive opening balance, present as positive. --}}
@if('Initial balance account' === $transaction['source_account_type'])
- {{ formatAmountBySymbol($transaction['amount']*-1, $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($transaction['amount']*-1, $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}
{{-- opening balance may have foreign amount (also pos) --}}
@if(null !== $transaction['foreign_amount'])
- ({{ formatAmountBySymbol($transaction['foreign_amount']*-1, $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) }})
+ ({!! formatAmountBySymbol($transaction['foreign_amount']*-1, $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) !!})
@endif
{{-- possibly, primary amount. --}}
@if($convertToPrimary && 0 !== $transaction['pc_amount'])
- (~ {{ formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
@else
{{-- withdrawal but also any other transaction type: --}}
- {{ formatAmountBySymbol($transaction['amount'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($transaction['amount'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}
@if(null !== $transaction['foreign_amount'])
- ({{ formatAmountBySymbol($transaction['foreign_amount'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) }})
+ ({!! formatAmountBySymbol($transaction['foreign_amount'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) !!})
@endif
@if($convertToPrimary && 0 !== $transaction['pc_amount'])
- (~ {{ formatAmountBySymbol($transaction['pc_amount'], $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($transaction['pc_amount'], $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
@endif
@elseif('Reconciliation' === $transaction['transaction_type_type'])
{{-- Reconciliation positive--}}
@if('Reconciliation account' === $transaction['source_account_type'])
{{-- amount, also foreign and converted. --}}
- {{ formatAmountBySymbol($transaction['amount']*-1, $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($transaction['amount']*-1, $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}
@if(null !== $transaction['foreign_amount'])
- ({{ formatAmountBySymbol($transaction['foreign_amount']*-1, $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) }})
+ ({!! formatAmountBySymbol($transaction['foreign_amount']*-1, $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) !!})
@endif
@if($convertToPrimary && 0 !== $transaction['pc_amount'])
- (~ {{ formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
@else
{{-- Reconciliation negative --}}
- {{ formatAmountBySymbol($transaction['amount'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($transaction['amount'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}
@if(null !== $transaction['foreign_amount'])
- ({{ formatAmountBySymbol($transaction['foreign_amount'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) }})
+ ({!! formatAmountBySymbol($transaction['foreign_amount'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) !!})
@endif
@if($convertToPrimary && 0 !== $transaction['pc_amount'])
- (~ {{ formatAmountBySymbol($transaction['pc_amount'], $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($transaction['pc_amount'], $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
@endif
@elseif('Liability credit' === $transaction['transaction_type_type'])
{{-- liability credit positive--}}
@if('Liability credit' === $transaction['source_account_type'])
- {{ formatAmountBySymbol($transaction['amount'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($transaction['amount'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}
@if(null !== $transaction['foreign_amount'])
- ({{ formatAmountBySymbol($transaction['foreign_amount'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) }})
+ ({!! formatAmountBySymbol($transaction['foreign_amount'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) !!})
@endif
@if($convertToPrimary && 0 !== $transaction['pc_amount'])
- (~ {{ formatAmountBySymbol($transaction['pc_amount'], $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($transaction['pc_amount'], $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
@else
- {{ formatAmountBySymbol($transaction['amount']*-1, $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($transaction['amount']*-1, $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}
@if(null !== $transaction['foreign_amount'])
- ({{ formatAmountBySymbol($transaction['foreign_amount']*-1, $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) }})
+ ({!! formatAmountBySymbol($transaction['foreign_amount']*-1, $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) !!})
@endif
@if($convertToPrimary && 0 !== $transaction['pc_amount'])
- (~ {{ formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
@endif
@else
{{-- THE REST most likely, withdrawal but also any other transaction type: --}}
- {{ formatAmountBySymbol($transaction['amount'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($transaction['amount'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}
{{-- foreign amount of withdrawal --}}
@if(null !== $transaction['foreign_amount'])
- ({{ formatAmountBySymbol($transaction['foreign_amount'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) }})
+ ({!! formatAmountBySymbol($transaction['foreign_amount'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) !!})
@endif
{{-- primary currency amount of withdrawal, if not in foreign currency --}}
@if($convertToPrimary && 0 !== $transaction['pc_amount'] && $primaryCurrency->id !== $transaction['foreign_currency_id'])
- (~ {{ formatAmountBySymbol($transaction['pc_amount'], $primaryCurrency->symbol, $primaryCurrency->decimal_places) }})
+ (~ {!! formatAmountBySymbol($transaction['pc_amount'], $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
@endif
@endif
</td>
@if(\FireflyIII\Support\Facades\AppConfiguration::get('use_running_balance', true))
<td class=" {{ $className }} text-end">
{{-- RUNNING BALANCE --}}
- @if((null === $transaction['balance_dirty'] || false === $transaction['balance_dirty']) && null !== $transaction['destination_balance_after'] && null !== $transaction['source_balance_after'])
+ @if((null === ($transaction['balance_dirty'] ?? null) || false === ($transaction['balance_dirty'] ?? null)) && null !== $transaction['destination_balance_after'] && null !== $transaction['source_balance_after'])
@if('Deposit' === $transaction['transaction_type_type'])
@if($transaction['source_account_id'] == $account?->id)
- <span title="Deposit, source">{{ formatAmountBySymbol($transaction['source_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}</span>
+ <span title="Deposit, source">{!! formatAmountBySymbol($transaction['source_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}</span>
@else
@if('Revenue account' === $transaction['source_account_type'])
- <span title="Deposit from revenue">{{ formatAmountBySymbol($transaction['destination_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}</span>
+ <span title="Deposit from revenue">{!! formatAmountBySymbol($transaction['destination_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}</span>
@else
- <span title="Deposit from liab">{{ formatAmountBySymbol($transaction['destination_balance_after'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) }}</span>
+ <span title="Deposit from liab">{!! formatAmountBySymbol($transaction['destination_balance_after'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) !!}</span>
@endif
{{-- if this is a deposit from revenue account, use the destination account currency? For #12043 and #12169. Otherwise, keep at source account -}}
{{-- changed from normal currency_symbol to foreign_currency_symbol for #12043 --}}
@@ -295,43 +292,43 @@
@if(in_array($transaction['destination_account_type'], ['Mortgage','Debt','Loan'], true))
@if($currency['id'] === $transaction['currency_id'])
@if($account?->id === $transaction['source_account_id'])
- <span title="Withdrawal, liab, source">{{ formatAmountBySymbol($transaction['source_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}</span>
+ <span title="Withdrawal, liab, source">{!! formatAmountBySymbol($transaction['source_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}</span>
@elseif($account?->id === $transaction['destination_account_id'])
- <span title="Withdrawal, liab, dest">{{ formatAmountBySymbol($transaction['destination_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}</span>
+ <span title="Withdrawal, liab, dest">{!! formatAmountBySymbol($transaction['destination_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}</span>
@else
-
@endif
@endif
@if($currency['id'] === $transaction['foreign_currency_id'] && null !== $transaction['destination_balance_after'] && null !== $transaction['destination_balance_after'])
- <span title="Withdrawal, liab, dest 2">{{ formatAmountBySymbol($transaction['destination_balance_after'], $transaction['foreign_currency_symbol'] ?? $transaction['currency_symbol'], $transaction['foreign_currency_decimal_places'] ?? $transaction['currency_decimal_places']) }}</span>
+ <span title="Withdrawal, liab, dest 2">{!! formatAmountBySymbol($transaction['destination_balance_after'], $transaction['foreign_currency_symbol'] ?? $transaction['currency_symbol'], $transaction['foreign_currency_decimal_places'] ?? $transaction['currency_decimal_places']) !!}</span>
@endif
{{-- withdrawal into an expense account --}}
@else
@if($account?->id === $transaction['source_account_id'])
- <span title="Withdrawal, source">{{ formatAmountBySymbol($transaction['source_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}</span>
+ <span title="Withdrawal, source">{!! formatAmountBySymbol($transaction['source_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}</span>
@elseif($account?->id === $transaction['destination_account_id'])
- <span title="Withdrawal, dest">{{ formatAmountBySymbol($transaction['destination_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}</span>
+ <span title="Withdrawal, dest">{!! formatAmountBySymbol($transaction['destination_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}</span>
@else
-
@endif
@endif
@elseif('Opening balance' === $transaction['transaction_type_type'])
@if($account?->id == $transaction['source_account_id'])
- <span title="Opening balance, src">{{ formatAmountBySymbol($transaction['source_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}</span>
+ <span title="Opening balance, src">{!! formatAmountBySymbol($transaction['source_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}</span>
@elseif($account?->id == $transaction['destination_account_id'])
- <span title="Opening balance, dest">{{ formatAmountBySymbol($transaction['destination_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}</span>
+ <span title="Opening balance, dest">{!! formatAmountBySymbol($transaction['destination_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}</span>
@else
-
@endif
@elseif('Transfer' === $transaction['transaction_type_type'])
@if($account?->id == $transaction['source_account_id'])
- <span title="Transfer, source">{{ formatAmountBySymbol($transaction['source_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}</span>
+ <span title="Transfer, source">{!! formatAmountBySymbol($transaction['source_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}</span>
@else
@if(null === $transaction['foreign_currency_id'])
- <span title="Transfer, dest, normal currency">{{ formatAmountBySymbol($transaction['destination_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) }}</span>
+ <span title="Transfer, dest, normal currency">{!! formatAmountBySymbol($transaction['destination_balance_after'], $transaction['currency_symbol'], $transaction['currency_decimal_places']) !!}</span>
@endif
@if(null !== $transaction['foreign_currency_id'])
- <span title="Transfer, dest, foreign currency">{{ formatAmountBySymbol($transaction['destination_balance_after'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) }}</span>
+ <span title="Transfer, dest, foreign currency">{!! formatAmountBySymbol($transaction['destination_balance_after'], $transaction['foreign_currency_symbol'], $transaction['foreign_currency_decimal_places']) !!}</span>
@endif
@endif
@else
@@ -366,7 +363,7 @@
@endif
</td>
@endif
- @if($showBudget)
+ @if($showBudget ?? false)
<td class="d-xs-none {{ $className }}">
@if(null !== $transaction['budget_id'])
<a href="{{ route('budgets.show', [$transaction['budget_id']]) }}"
@@ -375,20 +372,20 @@
</td>
@endif
- @if(1 === count($group))
+ @if(1 === $group['count'])
<td class="d-xs-none {{ $className }}">
<div class="btn-group btn-group-sm pull-right">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
{{ __('firefly.actions') }} <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
- <li><a href="{{ route('transactions.edit', [$group->id]) }}"><span class="fa fa-fw fa-pencil"></span> {{ __('firefly.edit') }}</a></li>
+ <li><a href="{{ route('transactions.edit', [$group['id']]) }}"><span class="fa fa-fw fa-pencil"></span> {{ __('firefly.edit') }}</a></li>
@if($transaction['transaction_type_type'] !== 'Opening balance' && $transaction['transaction_type_type'] !== 'Liability credit')
- <li><a href="{{ route('transactions.delete', [$group->id]) }}"><span class="fa fa-fw fa-trash"></span> {{ __('firefly.delete') }}</a></li>
+ <li><a href="{{ route('transactions.delete', [$group['id']]) }}"><span class="fa fa-fw fa-trash"></span> {{ __('firefly.delete') }}</a></li>
@endif
@if($transaction['transaction_type_type'] !== 'Reconciliation' and $transaction['transaction_type_type'] !== 'Opening balance' and $transaction['transaction_type_type'] !== 'Liability credit')
- <li><a href="#" data-id="{{ $group->id }}" class="clone-transaction"><span class="fa fa-copy fa-fw"></span> {{ __('firefly.clone') }}</a></li>
- <li><a href="#" data-id="{{ $group->id }}" class="clone-transaction-and-edit"><span class="fa fa-copy fa-fw"></span> {{ __('firefly.clone_and_edit') }}</a></li>
+ <li><a href="#" data-id="{{ $group['id'] }}" class="clone-transaction"><span class="fa fa-copy fa-fw"></span> {{ __('firefly.clone') }}</a></li>
+ <li><a href="#" data-id="{{ $group['id'] }}" class="clone-transaction-and-edit"><span class="fa fa-copy fa-fw"></span> {{ __('firefly.clone_and_edit') }}</a></li>
<li><a href="{{ route('rules.create-from-journal', [$transaction['transaction_journal_id']]) }}"><span class="fa fa-fw fa-random"></span> {{ __('firefly.create_rule_from_transaction') }}</a></li>
@endif
</ul>
@@ -396,7 +393,7 @@
</td>
@endif
- @if(1 !== count($group))
+ @if(1 !== $group['count'])
<td class="d-xs-none {{ $className }}">
&nbsp;
</td>
@@ -439,7 +436,7 @@
</td>
</tr>
<tr>
- @if($showCategory || $showBudget)
+ @if($showCategory || $showBudget ?? false)
<td colspan="9" class="no-margin-pagination">{{ $groups->links('pagination.bootstrap-4') }}</td>
@else
<td colspan="8" class="no-margin-pagination">{{ $groups->links('pagination.bootstrap-4') }}</td>
diff --git a/resources/views/components/lists/periods.blade.php b/resources/views/components/lists/periods.blade.php
index 1a20e0e954..0f632134ed 100644
--- a/resources/views/components/lists/periods.blade.php
+++ b/resources/views/components/lists/periods.blade.php
@@ -18,7 +18,7 @@
<td class="third">{{ __('firefly.spent') }}</td>
<td class="text-right">
<span title="Count: {{ $entry['count'] }}">
- {{ formatAmountBySymbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
</span>
</td>
</tr>
@@ -32,9 +32,9 @@
<td class="text-right">
<span title="Count: {{ $entry['count'] }}">
@if($entry['amount'] < 0)
- {{ formatAmountBySymbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
@else
- {{ formatAmountBySymbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
@endif
</span>
</td>
@@ -48,7 +48,7 @@
<td class="third">{{ __('firefly.transferred') }}</td>
<td class="text-right">
<span title="Count: {{ $entry['count'] }}">
- {{ formatAmountBySymbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
</span>
</td>
</tr>
@@ -62,9 +62,9 @@
<td class="text-right">
<span title="Count: {{ $entry['count'] }}">
@if($entry['amount'] < 0)
- {{ formatAmountBySymbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
@else
- {{ formatAmountBySymbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
@endif
</span>
</td>
@@ -79,9 +79,9 @@
<td class="text-right">
<span title="Count: {{ $entry['count'] }}">
@if($entry['amount'] < 0)
- {{ formatAmountBySymbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
@else
- {{ formatAmountBySymbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) }}
+ {!! formatAmountBySymbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
@endif
</span>
</td>
diff --git a/resources/views/transactions/index.blade.php b/resources/views/transactions/index.blade.php
index d111ad77c4..6d38b44d59 100644
--- a/resources/views/transactions/index.blade.php
+++ b/resources/views/transactions/index.blade.php
@@ -65,25 +65,37 @@
<div class="@if(count($periods) > 0) col-lg-10 col-md-10 col-sm-12 @else col-lg-12 col-md-12 col-sm-12 @endif">
<div class="card mb-2">
<div class="card-header with-border">
- <h3 class="card-title">{{ $subTitle }}</h3>
- </div>
- <div class="card-body no-padding">
- <div class="p-2">
- <a href="{{ route('transactions.create', [$objectType]) }}" class="btn btn-success"><span class="fa fa-plus fa-fw"></span> {{ __('firefly.create_new_transaction') }}</a>
+ <div class="row">
+ <div class="col">
+ <h3 class="card-title">{{ $subTitle }}</h3>
+ </div>
+ <div class="col text-end">
+ <div class="dropdown">
+ <button class="btn btn-sm btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
+ <span class="bi bi-list"></span>
+ </button>
+ <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
+ <li><a class="dropdown-item" href="{{ route('transactions.create', [$objectType]) }}"><span
+ class="bi bi-plus-circle"></span> {{ __('firefly.create_new_transaction') }}
+ </a></li>
+ </ul>
+ </div>
+ </div>
</div>
- {{-- actual list --}}
- <x-lists.groups-large :groups="$groups" />
+ </div>
+ <div class="card-body p-0">
+ <x-lists.groups-large :groups="$groups" :account="null" />
</div>
<div class="card-footer">
{{-- links for other views --}}
@if(count($periods) > 0)
<p>
- <span class="fa fa-calendar"></span>
+ <span class="bi bi-calendar"></span>
<a href="{{ route('transactions.index.all', [$objectType]) }}">{{ __('firefly.show_all_no_filter') }}</a>
</p>
@else
<p>
- <span class="fa fa-calendar"></span>
+ <span class="bi bi-calendar"></span>
<a href="{{ route('transactions.index', [$objectType]) }}">{{ __('firefly.show_the_current_period_and_overview') }}</a>
</p>
@endif
@@ -113,7 +125,6 @@
@section('scripts')
@vite(['js/pages/transactions/index.js'])
{{-- required for groups.twig --}}
- <script type="text/javascript" src="v1/js/ff/list/groups.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" nonce="{{ $JS_NONCE }}">
var showAll = @if(count($periods) > 0) false @else true @endif;
var cloneGroupUrl = '{{ route('transactions.clone') }}';
@@ -130,4 +141,6 @@
<script type="text/javascript" src="v1/js/ff/charts.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/transactions/index.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
+ <script type="text/javascript" src="v1/js/ff/list/groups.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
+
@endsection