Skip to content

Firefly III: a personal finances manager

more view stuff

Sander Dorigoc4160485b752
diff --git a/app/Helpers/Functions/helpers.php b/app/Helpers/Functions/helpers.php
index b5247a8363..1e7e1dbf87 100644
--- a/app/Helpers/Functions/helpers.php
+++ b/app/Helpers/Functions/helpers.php
@@ -25,8 +25,10 @@ declare(strict_types=1);
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account;
+use FireflyIII\Models\Configuration;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Facades\Amount;
+use FireflyIII\Support\Facades\AppConfiguration;
use FireflyIII\Support\Facades\Steam;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
@@ -51,6 +53,16 @@ if (!function_exists('env_default_when_empty')) {
}
}
+if(!function_exists('getAppConfiguration')) {
+ function getAppConfiguration(string $name, mixed $default = null): mixed {
+ try {
+ return AppConfiguration::get($name, $default)?->data;
+ } catch (FireflyException) {
+ return null;
+ }
+ }
+}
+
if(!function_exists('formatAmountBySymbol')) {
function formatAmountBySymbol(string $amount, ?string $symbol = null, ?int $decimalPlaces = null, ?bool $coloured = null): string
{
diff --git a/app/View/Components/Elements/TransactionAmount.php b/app/View/Components/Elements/TransactionAmount.php
new file mode 100644
index 0000000000..98ffb9ad51
--- /dev/null
+++ b/app/View/Components/Elements/TransactionAmount.php
@@ -0,0 +1,37 @@
+<?php
+
+namespace FireflyIII\View\Components\Elements;
+
+use Closure;
+use FireflyIII\Models\Account;
+use Illuminate\Contracts\View\View;
+use Illuminate\View\Component;
+
+class TransactionAmount extends Component
+{
+ public string $type;
+ public array $amount;
+ public array $foreign;
+ public null|string $pcAmount;
+ public null|Account $account;
+
+ /**
+ * Create a new component instance.
+ */
+ public function __construct(string $type,array $amount, array $foreign, null|string $pcAmount, null|Account $account)
+ {
+ $this->type = $type;
+ $this->amount = $amount;
+ $this->foreign = $foreign;
+ $this->account = $account;
+ $this->pcAmount = $pcAmount;
+ }
+
+ /**
+ * Get the view / contents that represent the component.
+ */
+ public function render(): View|Closure|string
+ {
+ return view('components.elements.transaction-amount');
+ }
+}
diff --git a/app/View/Components/Elements/TransactionRunningBalance.php b/app/View/Components/Elements/TransactionRunningBalance.php
new file mode 100644
index 0000000000..b5778003d8
--- /dev/null
+++ b/app/View/Components/Elements/TransactionRunningBalance.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace FireflyIII\View\Components\Elements;
+
+use Closure;
+use Illuminate\Contracts\View\View;
+use Illuminate\View\Component;
+
+class TransactionRunningBalance extends Component
+{
+ public bool $balanceDirty;
+ public array $currency;
+ public array $foreign;
+ public array $source;
+ public array $destination;
+ public string $type;
+ public null|Account $account;
+ /**
+ * Create a new component instance.
+ */
+ public function __construct(
+ bool|null $balanceDirty,
+ array $source,
+ array $destination,
+ array $currency,
+ array $foreign, string $type,
+ null|Account $account
+ )
+ {
+ $this->balanceDirty = $balanceDirty ?? false;
+ $this->currency = $currency;
+ $this->foreign= $foreign;
+ $this->type = $type;
+ $this->source = $source;
+ $this->destination = $destination;
+ $this->account = $account;
+ }
+
+ /**
+ * Get the view / contents that represent the component.
+ */
+ public function render(): View|Closure|string
+ {
+ return view('components.elements.transaction-running-balance');
+ }
+}
diff --git a/app/View/Components/Elements/TransactionTypeIcon.php b/app/View/Components/Elements/TransactionTypeIcon.php
new file mode 100644
index 0000000000..b43ec3e848
--- /dev/null
+++ b/app/View/Components/Elements/TransactionTypeIcon.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace FireflyIII\View\Components\Elements;
+
+use Closure;
+use Illuminate\Contracts\View\View;
+use Illuminate\View\Component;
+
+class TransactionTypeIcon extends Component
+{
+ public string $type;
+ /**
+ * Create a new component instance.
+ */
+ public function __construct(string $type)
+ {
+ $this->type = $type;
+ }
+
+ /**
+ * Get the view / contents that represent the component.
+ */
+ public function render(): View|Closure|string
+ {
+ return view('components.elements.transaction-type-icon');
+ }
+}
diff --git a/resources/views/accounts/index.blade.php b/resources/views/accounts/index.blade.php
index 4d60fedbcd..90f05c75f6 100644
--- a/resources/views/accounts/index.blade.php
+++ b/resources/views/accounts/index.blade.php
@@ -4,45 +4,13 @@
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="card" id="account-index-{{ $objectType }}">
- <div class="card-header">
- <div class="row">
- <div class="col">
- <div class="card-title">{{ trans('firefly.'.$objectType.'_accounts') }}</div>
- </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('accounts.create', $objectType) }}"><span
- class="bi bi-plus-circle"></span> {{ __('firefly.make_new_'. $objectType . '_account') }}
- </a></li>
- </ul>
- </div>
- </div>
- </div>
- </div>
+ <x-elements.card-header-with-menu
+ :cardTitle="trans('firefly.'.$objectType.'_accounts')" :route="route('accounts.create', $objectType)" :linkTitle="__('firefly.make_new_'. $objectType . '_account')"
+ />
<div class="card-body p-0">
<x-lists.accounts :accounts="$accounts" :objectType="$objectType" />
</div>
- <div class="card-footer">
- <div class="row">
- <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('accounts.create', $objectType) }}"><span
- class="bi bi-plus-circle"></span> {{ __('firefly.make_new_'. $objectType . '_account') }}
- </a></li>
- </ul>
- </div>
- </div>
- </div>
-
- </div>
+ <x-elements.card-footer-with-menu :route="route('accounts.create', $objectType)" :linkTitle="__('firefly.make_new_'. $objectType . '_account')" />
</div>
@if($inactiveCount > 0 && !$inactivePage)
<p class="m-2"><small>
diff --git a/resources/views/components/elements/transaction-amount.blade.php b/resources/views/components/elements/transaction-amount.blade.php
new file mode 100644
index 0000000000..9468386bf1
--- /dev/null
+++ b/resources/views/components/elements/transaction-amount.blade.php
@@ -0,0 +1,113 @@
+<!-- TODO amount display helper -->
+{{-- deposit --}}
+@if('Deposit' === $type)
+ {{-- amount of deposit --}}
+ {!! formatAmountBySymbol($amount['amount']*-1, $amount['currency_symbol'], $amount['currency_decimal_places']) !!}
+ {{-- foreign amount of deposit --}}
+ @if(null !== $foreign['amount'])
+ ({!! formatAmountBySymbol($foreign['amount']*-1, $foreign['currency_symbol'], $foreign['currency_decimal_places']) !!})
+ @endif
+ {{-- primary currency amount of deposit --}}
+ @if($convertToPrimary && 0 != $pcAmount)
+ (~ {!! formatAmountBySymbol($pcAmount*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
+ @endif
+ {{-- transfer --}}
+@elseif('Transfer' === $type)
+ {{-- amount of transfer --}}
+ <span class="text-info money-transfer">
+ {{-- present as negative. --}}
+ @if($transaction['source_account_id'] === $account?->id)
+ neg {!! formatAmountBySymbol($amount['amount'], $amount['currency_symbol'], $amount['currency_decimal_places'], false) !!}
+ @endif
+ {{-- present as positive --}}
+ @if($transaction['source_account_id'] !== $account?->id)
+ {!! formatAmountBySymbol($amount['amount']*-1, $amount['currency_symbol'], $amount['currency_decimal_places'], false) !!}
+ @endif
+ {{-- foreign amount of transfer (negative) --}}
+ @if(null !== $foreign['amount'] && $transaction['source_account_id'] === $account?->id)
+ neg ({!! formatAmountBySymbol($foreign['amount'], $foreign['currency_symbol'], $foreign['currency_decimal_places'], false) !!})
+ @endif
+ {{-- foreign amount of transfer (positive) --}}
+ @if(null !== $foreign['amount'] && $transaction['source_account_id'] !== $account?->id)
+ ({!! formatAmountBySymbol($foreign['amount']*-1, $foreign['currency_symbol'], $foreign['currency_decimal_places'], false) !!})
+ @endif
+ {{-- transfer in primary currency. Does not care about direction. --}}
+ @if($convertToPrimary && 0 !== $pcAmount)
+ (~ {!! formatAmountBySymbol($pcAmount*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
+ @endif
+ </span>
+ {{-- opening balance --}}
+@elseif('Opening balance' === $type)
+ {{-- Is a positive opening balance, present as positive. --}}
+ @if('Initial balance account' === $transaction['source_account_type'])
+ {!! formatAmountBySymbol($amount['amount']*-1, $amount['currency_symbol'], $amount['currency_decimal_places']) !!}
+ {{-- opening balance may have foreign amount (also pos) --}}
+ @if(null !== $foreign['amount'])
+ ({!! formatAmountBySymbol($foreign['amount']*-1, $foreign['currency_symbol'], $foreign['currency_decimal_places']) !!})
+ @endif
+ {{-- possibly, primary amount. --}}
+ @if($convertToPrimary && 0 !== $pcAmount)
+ (~ {!! formatAmountBySymbol($pcAmount*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
+ @endif
+ @else
+ {{-- withdrawal but also any other transaction type: --}}
+ {!! formatAmountBySymbol($amount['amount'], $amount['currency_symbol'], $amount['currency_decimal_places']) !!}
+ @if(null !== $foreign['amount'])
+ ({!! formatAmountBySymbol($foreign['amount'], $foreign['currency_symbol'], $foreign['currency_decimal_places']) !!})
+ @endif
+ @if($convertToPrimary && 0 !== $pcAmount)
+ (~ {!! formatAmountBySymbol($pcAmount, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
+ @endif
+ @endif
+@elseif('Reconciliation' === $type)
+ {{-- Reconciliation positive--}}
+ @if('Reconciliation account' === $transaction['source_account_type'])
+ {{-- amount, also foreign and converted. --}}
+ {!! formatAmountBySymbol($amount['amount']*-1, $amount['currency_symbol'], $amount['currency_decimal_places']) !!}
+ @if(null !== $foreign['amount'])
+ ({!! formatAmountBySymbol($foreign['amount']*-1, $foreign['currency_symbol'], $foreign['currency_decimal_places']) !!})
+ @endif
+ @if($convertToPrimary && 0 !== $pcAmount)
+ (~ {!! formatAmountBySymbol($pcAmount*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
+ @endif
+ @else
+ {{-- Reconciliation negative --}}
+ {!! formatAmountBySymbol($amount['amount'], $amount['currency_symbol'], $amount['currency_decimal_places']) !!}
+ @if(null !== $foreign['amount'])
+ ({!! formatAmountBySymbol($foreign['amount'], $foreign['currency_symbol'], $foreign['currency_decimal_places']) !!})
+ @endif
+ @if($convertToPrimary && 0 !== $pcAmount)
+ (~ {!! formatAmountBySymbol($pcAmount, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
+ @endif
+ @endif
+@elseif('Liability credit' === $type)
+ {{-- liability credit positive--}}
+ @if('Liability credit' === $transaction['source_account_type'])
+ {!! formatAmountBySymbol($amount['amount'], $amount['currency_symbol'], $amount['currency_decimal_places']) !!}
+ @if(null !== $foreign['amount'])
+ ({!! formatAmountBySymbol($foreign['amount'], $foreign['currency_symbol'], $foreign['currency_decimal_places']) !!})
+ @endif
+ @if($convertToPrimary && 0 !== $pcAmount)
+ (~ {!! formatAmountBySymbol($pcAmount, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
+ @endif
+ @else
+ {!! formatAmountBySymbol($amount['amount']*-1, $amount['currency_symbol'], $amount['currency_decimal_places']) !!}
+ @if(null !== $foreign['amount'])
+ ({!! formatAmountBySymbol($foreign['amount']*-1, $foreign['currency_symbol'], $foreign['currency_decimal_places']) !!})
+ @endif
+ @if($convertToPrimary && 0 !== $pcAmount)
+ (~ {!! formatAmountBySymbol($pcAmount*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
+ @endif
+ @endif
+@else
+ {{-- THE REST most likely, withdrawal but also any other transaction type: --}}
+ {!! formatAmountBySymbol($amount['amount'], $amount['currency_symbol'], $amount['currency_decimal_places']) !!}
+ {{-- foreign amount of withdrawal --}}
+ @if(null !== $foreign['amount'])
+ ({!! formatAmountBySymbol($foreign['amount'], $foreign['currency_symbol'], $foreign['currency_decimal_places']) !!})
+ @endif
+ {{-- primary currency amount of withdrawal, if not in foreign currency --}}
+ @if($convertToPrimary && 0 !== $pcAmount && $primaryCurrency->id !== $foreign['currency_id'])
+ (~ {!! formatAmountBySymbol($pcAmount, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
+ @endif
+@endif
diff --git a/resources/views/components/elements/transaction-running-balance.blade.php b/resources/views/components/elements/transaction-running-balance.blade.php
new file mode 100644
index 0000000000..6601490346
--- /dev/null
+++ b/resources/views/components/elements/transaction-running-balance.blade.php
@@ -0,0 +1,57 @@
+{{-- RUNNING BALANCE --}}
+@if(false === $balanceDirty && '' !== $destination['balance_after'] && '' !== $source['balance_after'])
+ @if('Deposit' === $type)
+ @if($source['id'] === $account?->id)
+ <span title="Deposit, source">{!! formatAmountBySymbol($source['balance_after'], $currency['symbol'], $currency['decimal_places']) !!}</span>
+ @else
+ @if('Revenue account' === $source['type'])
+ <span title="Deposit from revenue">{!! formatAmountBySymbol($destination['balance_after'], $currency['symbol'], $currency['decimal_places']) !!}</span>
+ @else
+ <span title="Deposit from liab">{!! formatAmountBySymbol($destination['balance_after'], $foreign['currency_symbol'], $foreign['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 --}}
+ @endif
+ @elseif('Withdrawal' === $type)
+ {{-- withdrawal into a liability --}}
+ @if(in_array($destination['type'], ['Mortgage','Debt','Loan'], true))
+ @if($account?->id === $source['id'])
+ <span title="Withdrawal, liab, source">{!! formatAmountBySymbol($source['balance_after'], $currency['symbol'], $currency['decimal_places']) !!}</span>
+ @elseif($account?->id === $destination['id'])
+ <span title="Withdrawal, liab, dest">{!! formatAmountBySymbol($destination['balance_after'], $currency['symbol'], $currency['decimal_places']) !!}</span>
+ @else
+ -
+ @endif
+ {{-- withdrawal into an expense account --}}
+ @else
+ @if($account?->id === $source['id'])
+ <span title="Withdrawal, source">{!! formatAmountBySymbol($source['balance_after'], $currency['symbol'], $currency['decimal_places']) !!}</span>
+ @elseif($account?->id === $destination['id'])
+ <span title="Withdrawal, dest">{!! formatAmountBySymbol($destination['balance_after'], $currency['symbol'], $currency['decimal_places']) !!}</span>
+ @else
+ -
+ @endif
+ @endif
+ @elseif('Opening balance' === $type)
+ @if($account?->id == $source['id'])
+ <span title="Opening balance, src">{!! formatAmountBySymbol($source['balance_after'], $currency['symbol'], $currency['decimal_places']) !!}</span>
+ @elseif($account?->id == $destination['id'])
+ <span title="Opening balance, dest">{!! formatAmountBySymbol($destination['balance_after'], $currency['symbol'], $currency['decimal_places']) !!}</span>
+ @else
+ -
+ @endif
+ @elseif('Transfer' === $type)
+ @if($account?->id == $source['id'])
+ <span title="Transfer, source">{!! formatAmountBySymbol($source['balance_after'], $currency['symbol'], $currency['decimal_places']) !!}</span>
+ @else
+ @if(null === $foreign['id'])
+ <span title="Transfer, dest, normal currency">{!! formatAmountBySymbol($destination['balance_after'], $currency['symbol'], $currency['decimal_places']) !!}</span>
+ @endif
+ @if(null !== $foreign['id'])
+ <span title="Transfer, dest, foreign currency">{!! formatAmountBySymbol($destination['balance_after'], $foreign['currency_symbol'], $foreign['decimal_places']) !!}</span>
+ @endif
+ @endif
+ @else
+ &nbsp;
+ @endif
+@endif
diff --git a/resources/views/components/elements/transaction-type-icon.blade.php b/resources/views/components/elements/transaction-type-icon.blade.php
new file mode 100644
index 0000000000..fa0afecd6b
--- /dev/null
+++ b/resources/views/components/elements/transaction-type-icon.blade.php
@@ -0,0 +1,22 @@
+<!-- TODO icon helper -->
+@if('Withdrawal' === $type)
+ <span class="bi bi-arrow-left" title="{{ trans('firefly.Withdrawal') }}"></span>
+@endif
+
+@if('Deposit' === $type)
+ <span class="bi bi-arrow-right" title="{{ trans('firefly.Deposit') }}"></span>
+@endif
+
+@if('Transfer' === $type)
+ <span class="bi bi-arrow-left-right" title="{{ trans('firefly.Transfer') }}"></span>
+@endif
+
+@if('Reconciliation' === $type)
+ <span class="bi bi-calculator" title="{{ trans('firefly.reconciliation_transaction') }}"></span>
+@endif
+@if('Opening balance' === $type)
+ <span class="bi bi-star" title="{{ trans('firefly.Opening balance') }}"></span>
+@endif
+@if('Liability credit' === $type)
+ <span class="bi bi-star" title="{{ trans('firefly.Liability credit') }}"></span>
+@endif
diff --git a/resources/views/components/layout/sidebar.blade.php b/resources/views/components/layout/sidebar.blade.php
index 2133ef6d24..29f91a70c6 100644
--- a/resources/views/components/layout/sidebar.blade.php
+++ b/resources/views/components/layout/sidebar.blade.php
@@ -65,25 +65,25 @@
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
- <a href="{{ route('transactions.index', ['withdrawal']) }}" class="nav-link">
+ <a href="{{ route('transactions.index', ['withdrawal']) }}" class="nav-link {{ \FireflyIII\Support\Blade\Navigation::menuSubItemActive('transactions.index','withdrawal') }}">
<em class="nav-icon bi bi-arrow-left"></em>
<p>{{ __('firefly.expenses') }}</p>
</a>
</li>
<li class="nav-item">
- <a href="{{ route('transactions.index', ['deposit']) }}" class="nav-link">
+ <a href="{{ route('transactions.index', ['deposit']) }}" class="nav-link {{ \FireflyIII\Support\Blade\Navigation::menuSubItemActive('transactions.index','deposit') }}">
<em class="nav-icon bi bi-arrow-right"></em>
<p>{{ __('firefly.income') }}</p>
</a>
</li>
<li class="nav-item">
- <a href="{{ route('transactions.index', ['transfers']) }}" class="nav-link">
+ <a href="{{ route('transactions.index', ['transfers']) }}" class="nav-link {{ \FireflyIII\Support\Blade\Navigation::menuSubItemActive('transactions.index','transfers') }}">
<em class="nav-icon bi bi-arrow-left-right"></em>
<p>{{ __('firefly.transfers') }}</p>
</a>
</li>
<li class="nav-item">
- <a href="{{ route('transactions.index', ['all']) }}" class="nav-link">
+ <a href="{{ route('transactions.index', ['all']) }}" class="nav-link {{ \FireflyIII\Support\Blade\Navigation::menuSubItemActive('transactions.index','all') }}">
<em class="nav-icon bi bi-arrow-repeat"></em>
<p>{{ __('firefly.all_transactions') }}</p>
</a>
diff --git a/resources/views/components/lists/accounts.blade.php b/resources/views/components/lists/accounts.blade.php
index 46a2315fcc..1ee4e7a36e 100644
--- a/resources/views/components/lists/accounts.blade.php
+++ b/resources/views/components/lists/accounts.blade.php
@@ -1,7 +1,7 @@
<div class="m-2">
{{ $accounts->links('pagination.bootstrap-4') }}
</div>
-<table class="table table-responsive table-hover" id="sortable-table">
+<table class="table table-sm table-hover" id="sortable-table">
<thead>
<tr>
<th class="hidden-sm hidden-xs">&nbsp;</th>
@@ -136,7 +136,7 @@
</td>
<td class="hidden-sm hidden-xs justify-content-end">
<div class="dropdown">
- <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" id="action_menu_{{$account->id}}" data-bs-toggle="dropdown" aria-expanded="false">
+ <button class="btn btn-outline-secondary btn-sm dropdown-toggle" type="button" id="action_menu_{{$account->id}}" data-bs-toggle="dropdown" aria-expanded="false">
{{ __('firefly.actions') }}
</button>
<ul class="dropdown-menu" aria-labelledby="action_menu_{{$account->id}}">
diff --git a/resources/views/components/lists/groups-large.blade.php b/resources/views/components/lists/groups-large.blade.php
index 354aca36f2..03aaf19d52 100644
--- a/resources/views/components/lists/groups-large.blade.php
+++ b/resources/views/components/lists/groups-large.blade.php
@@ -1,4 +1,4 @@
-<table class="table table-condensed table-bordered table-hover table-responsive">
+<table class="table table-sm">
<thead>
<tr>
@if(($showCategory ?? false) || ($showBudget ?? false))
@@ -6,19 +6,16 @@
@else
<td colspan="7">{{ $groups->links('pagination.bootstrap-4') }}</td>
@endif
- <td class="d-xs-none">
+ <td class="d-xs-none text-end">
<!-- Single button -->
- <div class="dropdown action-menu d-none">
+ <div class="action-menu d-none"> <!-- 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" 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="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="dropdown-item mass-delete"><span class="fa fa-fw fa-trash"></span>
- <span class="txt">{{ __('firefly.mass_delete') }}</span></a></li>
+ <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="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="dropdown-item mass-delete"><span class="fa fa-fw fa-trash"></span><span class="txt">{{ __('firefly.mass_delete') }}</span></a></li>
</ul>
</div>
</td>
@@ -30,17 +27,17 @@
<th class="d-xs-none">&nbsp;</th>
<th>{{ trans('list.description') }}</th>
<th class="text-end">{{ trans('list.amount') }}</th>
- @if(\FireflyIII\Support\Facades\AppConfiguration::get('use_running_balance', true))
+ @if(getAppConfiguration('use_running_balance', true))
<th class="text-end">{{ trans('list.running_balance') }}</th>
@endif
<th>{{ trans('list.date') }}</th>
<th>{{ trans('list.source_account') }}</th>
<th>{{ trans('list.destination_account') }}</th>
@if($showCategory)
- <th class="d-xs-none">{{ trans('list.category') }}</th>
+ <th class="d-xs-none">{{ trans('list.category') }}</th>
@endif
@if($showBudget ?? false)
- <th class="d-xs-none">{{ trans('list.budget') }}</th>
+ <th class="d-xs-none">{{ trans('list.budget') }}</th>
@endif
<th class="d-xs-none">&nbsp;</th><!-- actions -->
<th class="d-xs-none">&nbsp;</th><!-- checkbox -->
@@ -48,63 +45,56 @@
</thead>
<tbody>
@foreach($groups as $group)
- @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>
- </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']) !!}
- @if($convertToPrimary && 0 !== $sum['pc_amount'])
- (~ {!! 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) !!}
- @if($convertToPrimary && 0 !== $sum['pc_amount'])
- (~ {!! formatAmountBySymbol($sum['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
- @endif
- @if($loop->index !== count($group['sums'])),@endif
- </span>
+ @if($group['count'] > 1)
+ <tr class="top-light-border">
+ <td colspan="2">
+ <small><strong><a href="{{ route('transactions.show', [$group['id']]) }}" title="{{ $group['title'] }}">{{ $group['title'] }}</a></strong></small>
+ </td>
+ <td colspan="1" class="text-end">
+ {{-- Total amount of all journals in the group. --}}
+ @foreach($group['sums'] as $sum)
+ @if('Deposit' === $group['transaction_type'])
+ {!! 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) !!})
+ @endif
+ @if($loop->index !== count($group['sums'])-1),@endif
+ @elseif('Transfer' === $group['transaction_type'])
+ <span class="text-info money-transfer">
+ {!! 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) !!})
+ @endif
+ @if($loop->index !== count($group['sums'])-1),@endif
+ </span>
+ @else
+ {!! formatAmountBySymbol($sum['amount'], $sum['currency_symbol'], $sum['currency_decimal_places']) !!}
+ @if($convertToPrimary && 0 !== $sum['pc_amount'])
+ (~ {!! formatAmountBySymbol($sum['pc_amount'], $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
+ @endif
+ @if($loop->index !== count($group['sums'])-1),@endif
+ @endif
+ @endforeach
+ </td>
+ <!-- column to span accounts + extra fields -->
+ @if($showCategory ?? false || $showBudget ?? false)
+ <td colspan="5" class="top-light-border">&nbsp;</td>
@else
- {!! 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) !!})
- @endif
- @if($loop->index !== count($group['sums'])),@endif
+ <td colspan="4" class="top-light-border">&nbsp;b</td>
@endif
- @endforeach
- </td>
- <!-- column to span accounts + extra fields -->
- @if($showCategory || $showBudget ?? false)
- <td class="top-light-border" colspan="3">&nbsp;</td>
- @else
- <td class="top-light-border" colspan="2">&nbsp;</td>
- @endif
- <td class="top-light-border d-xs-none" colspan="2">
- <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>
+ <td class="top-light-border d-xs-none text-end">
+ <div class=""> <!-- d-none ? -->
+ <button type="button" class="btn btn-sm btn-outline-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.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
- 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('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 class="fa fa-fw fa-trash"></span> {{ __('firefly.delete') }}</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>
</ul>
</div>
</td>
- <td class="top-light-border d-xs-none">&nbsp;</td>
+ <td class="top-light-border d-xs-none">&nbsp;</td><!-- would have checkbox -->
</tr>
@endif
@foreach($group['transactions'] as $index => $transaction)
@@ -114,227 +104,43 @@
@endif
<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'])
- <span class="fa fa-long-arrow-left fa-fw"
- title="{{ trans('firefly.Withdrawal') }}"></span>
- @endif
-
- @if('Deposit' === $transaction['transaction_type_type'])
- <span class="fa fa-long-arrow-right fa-fw"
- title="{{ trans('firefly.Deposit') }}"></span>
- @endif
-
- @if('Transfer' === $transaction['transaction_type_type'])
- <span class="fa fa-exchange fa-fw" title="{{ trans('firefly.Transfer') }}"></span>
- @endif
-
- @if('Reconciliation' === $transaction['transaction_type_type'])
- <span class="fa-fw fa fa-calculator"
- title="{{ trans('firefly.reconciliation_transaction') }}"></span>
- @endif
- @if('Opening balance' === $transaction['transaction_type_type'])
- <span class="fa-fw fa fa-star-o" title="{{ trans('firefly.Opening balance') }}"></span>
- @endif
- @if('Liability credit' === $transaction['transaction_type_type'])
- <span class="fa-fw fa fa-star-o"
- title="{{ trans('firefly.Liability credit') }}"></span>
- @endif
+ <x-elements.transaction-type-icon :type="$transaction['transaction_type_type']" />
</td>
<td class="{{ $className }}">
@if($transaction['reconciled'])
- <span class="fa fa-check"></span>
+ <span class="bi bi-check"></span>
@endif
@if(count($transaction['attachments']) > 0)
- <span class="fa fa-paperclip"></span>
+ <span class="bi bi-paperclip"></span>
@endif
@if(1 === $group['count'])
<a href="{{ route('transactions.show', [$group['id']]) }}" title="{{ $transaction['description'] }}">
@endif
- {{ $transaction['description'] }}
- @if(1 === $group['count'])
- </a>
+ {{ $transaction['description'] }}
+ @if(1 === $group['count'])
+ </a>
@endif
</td>
<td class="{{ $className }} text-end">
- <!-- TODO amount display helper -->
- {{-- deposit --}}
- @if('Deposit' === $transaction['transaction_type_type'])
- {{-- amount of deposit --}}
- {!! 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']) !!})
- @endif
- {{-- primary currency amount of deposit --}}
- @if($convertToPrimary && 0 != $transaction['pc_amount'])
- (~ {!! formatAmountBySymbol($transaction['pc_amount']*-1, $primaryCurrency->symbol, $primaryCurrency->decimal_places) !!})
- @endif
- {{-- transfer --}}
- @elseif('Transfer' === $transaction['transaction_type_type'])
- {{-- amount of transfer --}}
- <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) !!}
- @endif
- {{-- present as positive --}}
- @if($transaction['source_account_id'] !== $account?->id)
- {!! 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) !!})
- @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) !!})
- @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) !!})
- @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']) !!}
- {{-- 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']) !!})
- @endif
- {{-- possibly, primary amount. --}}
- @if($convertToPrimary && 0 !== $transaction['pc_amount'])
- (~ {!! 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']) !!}
- @if(null !== $transaction['foreign_amount'])
- ({!! 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) !!})
- @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']) !!}
- @if(null !== $transaction['foreign_amount'])
- ({!! 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) !!})
- @endif
- @else
- {{-- Reconciliation negative --}}
- {!! 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']) !!})
- @endif
- @if($convertToPrimary && 0 !== $transaction['pc_amount'])
- (~ {!! 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']) !!}
- @if(null !== $transaction['foreign_amount'])
- ({!! 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) !!})
- @endif
- @else
- {!! 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']) !!})
- @endif
- @if($convertToPrimary && 0 !== $transaction['pc_amount'])
- (~ {!! 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']) !!}
- {{-- foreign amount of withdrawal --}}
- @if(null !== $transaction['foreign_amount'])
- ({!! 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) !!})
- @endif
- @endif
- </td>
- @if(\FireflyIII\Support\Facades\AppConfiguration::get('use_running_balance', true))
+ <x-elements.transaction-amount
+ :type="$transaction['transaction_type_type']"
+ :amount="['amount' => $transaction['amount'], 'currency_symbol' => $transaction['currency_symbol'], 'currency_decimal_places' => $transaction['currency_decimal_places']]"
+ :foreign="['amount' => $transaction['foreign_amount'],'currency_id' => $transaction['foreign_currency_id'], 'currency_symbol' => $transaction['foreign_currency_symbol'], 'currency_decimal_places' => $transaction['foreign_currency_decimal_places']]"
+ :account="$account ?? null"
+ :pc-amount="$transaction['pc_amount']"
+ />
+ </td>
+ @if(getAppConfiguration('use_running_balance', true))
<td class=" {{ $className }} text-end">
- {{-- RUNNING BALANCE --}}
- @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>
- @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>
- @else
- <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 --}}
- @endif
- @elseif('Withdrawal' === $transaction['transaction_type_type'])
- {{-- withdrawal into a liability --}}
- @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>
- @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>
- @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>
- @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>
- @elseif($account?->id === $transaction['destination_account_id'])
- <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>
- @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>
- @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>
- @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>
- @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>
- @endif
- @endif
- @else
- &nbsp;
- @endif
- @endif
+ <x-elements.transaction-running-balance
+ :balance-dirty="$transaction['balance_dirty'] ?? false"
+ :currency="[]"
+ :foreign="[]"
+ :type="$transaction['transaction_type_type']"
+ :account="$account ?? null"
+ :source="['id' => $transaction['source_account_id'], 'balance_after' => $transaction['source_balance_after'], 'type' => $transaction['source_account_type']]"
+ :destination="['id' => $transaction['destination_account_id'], 'balance_after' => $transaction['destination_balance_after'], 'type' => $transaction['destination_account_type']]"
+ />
</td>
@endif
<td class="{{ $className }}">
@@ -355,41 +161,36 @@
<a href="{{ route('accounts.show', [$transaction['destination_account_id'] ?? 1]) }}" title="{{ $transaction['destination_account_iban'] ?? $transaction['destination_account_name'] }}">{{ $transaction['destination_account_name'] }}</a>
@endif
</td>
- @if($showCategory)
- <td class="d-xs-none {{ $className }}">
- @if(null !== $transaction['category_id'])
- <a href="{{ route('categories.show', [$transaction['category_id']]) }}"
- title="{{ $transaction['category_name'] }}">{{ $transaction['category_name'] }}</a>
- @endif
- </td>
+ @if($showCategory ?? false)
+ <td class="d-xs-none {{ $className }}">
+ @if(null !== $transaction['category_id'])
+ <a href="{{ route('categories.show', [$transaction['category_id']]) }}" title="{{ $transaction['category_name'] }}">{{ $transaction['category_name'] }}</a>
+ @endif
+ </td>
@endif
@if($showBudget ?? false)
- <td class="d-xs-none {{ $className }}">
- @if(null !== $transaction['budget_id'])
- <a href="{{ route('budgets.show', [$transaction['budget_id']]) }}"
- title="{{ $transaction['budget_name'] }}">{{ $transaction['budget_name'] }}</a>
- @endif
- </td>
+ <td class="d-xs-none {{ $className }}">
+ @if(null !== $transaction['budget_id'])
+ <a href="{{ route('budgets.show', [$transaction['budget_id']]) }}"
+ title="{{ $transaction['budget_name'] }}">{{ $transaction['budget_name'] }}</a>
+ @endif
+ </td>
@endif
@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>
+ <td class="d-xs-none {{ $className }} text-end">
+ <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="journal_menu_{{ $transaction['transaction_journal_id'] }}" data-bs-toggle="dropdown" aria-expanded="false">{{ __('firefly.actions') }} <span class="caret"></span></button>
+ <ul class="dropdown-menu" aria-labelledby="journal_menu_{{ $transaction['transaction_journal_id'] }}">
+ <li><a class="dropdown-item" href="{{ route('transactions.edit', [$group['id']]) }}"><span class="bi bi-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 class="dropdown-item" href="{{ route('transactions.delete', [$group['id']]) }}"><span class="text-danger bi bi-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="{{ route('rules.create-from-journal', [$transaction['transaction_journal_id']]) }}"><span class="fa fa-fw fa-random"></span> {{ __('firefly.create_rule_from_transaction') }}</a></li>
+ <li><a class="dropdown-item" href="#" data-id="{{ $group['id'] }}" class="clone-transaction"><span class="bi bi-copy"></span> {{ __('firefly.clone') }}</a></li>
+ <li><a class="dropdown-item" href="#" data-id="{{ $group['id'] }}" class="clone-transaction-and-edit"><span class="bi bi-copy"></span> {{ __('firefly.clone_and_edit') }}</a></li>
+ <li><a class="dropdown-item" href="{{ route('rules.create-from-journal', [$transaction['transaction_journal_id']]) }}"><span class="bi bi-shuffle"></span> {{ __('firefly.create_rule_from_transaction') }}</a></li>
@endif
</ul>
- </div>
</td>
@endif
@@ -400,7 +201,7 @@
@endif
<td class="d-xs-none {{ $className }}">
@if($transaction['transaction_type_type'] !== 'Reconciliation' and $transaction['transaction_type_type'] !== 'Opening balance' and $transaction['transaction_type_type'] !== 'Liability credit')
- <div class="pull-right">
+ <div class="text-end">
<input id="list_{{ $transaction['transaction_journal_id'] }}"
value="{{ $transaction['transaction_journal_id'] }}"
name="journals[{{ $transaction['transaction_journal_id'] }}]"
@@ -415,25 +216,20 @@
</tbody>
<tfoot>
<tr>
- <td colspan="8">
- <div class="pull-right">
- <!-- Single button -->
- <div class="btn-group action-menu btn-group-sm pull-right hidden">
- <button type="button" class="btn btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown"
- aria-haspopup="true" aria-expanded="false">
- {{ __('firefly.actions') }} <span class="caret"></span>
- </button>
- <ul class="dropdown-menu btn-group-sm dropdown-menu-right">
- <li><a href="#" class="mass-edit"><span class="fa fa-fw fa-pencil"></span>
- <span>{{ __('firefly.mass_edit') }}</span></a></li>
- <li><a href="#" class="bulk-edit"><span class="fa fa-fw fa-pencil-square-o"></span>
- <span>{{ __('firefly.bulk_edit') }}</span></a></li>
- <li><a href="#" class="mass-delete"><span class="fa fa-fw fa-trash"></span>
- <span>{{ __('firefly.mass_delete') }}</span></a></li>
- </ul>
- </div>
+ <td colspan="8">&nbsp;</td>
+ <td class="d-xs-none text-end">
+ <div class="d-none action-menu">
+ <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="bottom_action_menu" data-bs-toggle="dropdown" aria-expanded="false">{{ __('firefly.actions') }} <span class="caret"></span></button>
+ <ul class="dropdown-menu" aria-labelledby="bottom_action_menu">
+ <li><a href="#" class="mass-edit dropdown-item"><span class="bi bi-pencil"></span><span>{{ __('firefly.mass_edit') }}</span></a></li>
+ <li><a href="#" class="bulk-edit dropdown-item"><span class="bi bi-pencil-square"></span><span>{{ __('firefly.bulk_edit') }}</span></a></li>
+ <li><a href="#" class="dropdown-item mass-delete"><span class="bi bi-trash"></span><span>{{ __('firefly.mass_delete') }}</span></a></li>
+ </ul>
</div>
</td>
+
+ <td>&nbsp;</td>
+
</tr>
<tr>
@if($showCategory || $showBudget ?? false)
diff --git a/resources/views/components/lists/periods.blade.php b/resources/views/components/lists/periods.blade.php
index 8a38fd9fa3..b188f2056b 100644
--- a/resources/views/components/lists/periods.blade.php
+++ b/resources/views/components/lists/periods.blade.php
@@ -12,36 +12,38 @@
<td class="text-right">{{ $period['total_transactions'] }}</td>
</tr>
@endif
- @foreach($period['spent'] ?? [] as $entry)
- @if(($entry['amount'] ?? 0) !== 0)
+ @if(array_key_exists('spent', $period))
+ @foreach($period['spent'] as $spent)
+ @if($spent['amount'] !== 0)
<tr>
<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']) !!}
+ <span title="Count: {{ $spent['count'] }}">
+ {!! formatAmountBySymbol($spent['amount'], $spent['currency_symbol'], $spent['currency_decimal_places']) !!}
</span>
</td>
</tr>
@endif
@endforeach
- @if(array_key_exists('earned', $entry))
- @foreach($period['earned'] as $entry)
- @if($entry['amount'] !== 0)
- <tr>
- <td class="third">{{ __('firefly.earned') }}</td>
- <td class="text-right">
- <span title="Count: {{ $entry['count'] }}">
- @if($entry['amount'] < 0)
- {!! formatAmountBySymbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
- @else
- {!! formatAmountBySymbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
- @endif
- </span>
- </td>
- </tr>
- @endif
- @endforeach
@endif
+ @if(array_key_exists('earned', $period))
+ @foreach($period['earned'] as $entry)
+ @if(is_array($entry) && $entry['amount'] !== 0)
+ <tr>
+ <td class="third">{{ __('firefly.earned') }}</td>
+ <td class="text-right">
+ <span title="Count: {{ $entry['count'] }}">
+ @if($entry['amount'] < 0)
+ {!! formatAmountBySymbol($entry['amount']*-1, $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
+ @else
+ {!! formatAmountBySymbol($entry['amount'], $entry['currency_symbol'], $entry['currency_decimal_places']) !!}
+ @endif
+ </span>
+ </td>
+ </tr>
+ @endif
+ @endforeach
+ @endif
@foreach($period['transferred'] ?? [] as $entry)
@if($entry['amount'] !== 0)
<tr>