Skip to content

Firefly III: a personal finances manager

Expand layout

James Cole18ad04ae84f3
diff --git a/app/Helpers/Functions/helpers.php b/app/Helpers/Functions/helpers.php
index 66471a65a7..b5247a8363 100644
--- a/app/Helpers/Functions/helpers.php
+++ b/app/Helpers/Functions/helpers.php
@@ -51,6 +51,13 @@ if (!function_exists('env_default_when_empty')) {
}
}
+if(!function_exists('formatAmountBySymbol')) {
+ function formatAmountBySymbol(string $amount, ?string $symbol = null, ?int $decimalPlaces = null, ?bool $coloured = null): string
+ {
+ return Steam::formatAmountBySymbol($amount, $symbol, $decimalPlaces, $coloured);
+ }
+}
+
if (!function_exists('bladeAccountGetMetaField')) {
function bladeAccountGetMetaField(Account $account, string $field): string
{
diff --git a/app/View/Components/Lists/GroupsLarge.php b/app/View/Components/Lists/GroupsLarge.php
new file mode 100644
index 0000000000..8592648523
--- /dev/null
+++ b/app/View/Components/Lists/GroupsLarge.php
@@ -0,0 +1,28 @@
+<?php
+
+namespace FireflyIII\View\Components\Lists;
+
+use Closure;
+use Illuminate\Contracts\View\View;
+use Illuminate\Pagination\LengthAwarePaginator;
+use Illuminate\View\Component;
+
+class GroupsLarge extends Component
+{
+ public LengthAwarePaginator $groups;
+ /**
+ * Create a new component instance.
+ */
+ public function __construct(LengthAwarePaginator $groups)
+ {
+ $this->groups = $groups;
+ }
+
+ /**
+ * Get the view / contents that represent the component.
+ */
+ public function render(): View|Closure|string
+ {
+ return view('components.lists.groups-large');
+ }
+}
diff --git a/resources/assets/v3/js/pages/transactions/index.js b/resources/assets/v3/js/pages/transactions/index.js
new file mode 100644
index 0000000000..217ae6c5fb
--- /dev/null
+++ b/resources/assets/v3/js/pages/transactions/index.js
@@ -0,0 +1,61 @@
+/*
+ * dashboard.js
+ * Copyright (c) 2026 [email protected]
+ *
+ * This file is part of Firefly III (https://github.com/firefly-iii).
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+// CSS
+import '../../boot/bootstrap.js';
+import sidebar from '../../pages/shared/sidebar.js';
+import dates from '../shared/dates.js';
+
+let index = function () {
+ return {
+ foo2: 'bar2',
+ init() {
+ console.log('init op index xxx');
+ }
+ }
+};
+
+
+const comps = {
+ index,
+ sidebar,
+ dates
+};
+
+function loadPage(comps) {
+ console.log('loadPage');
+ Object.keys(comps).forEach(comp => {
+ let data = comps[comp]();
+ Alpine.data(comp, () => data);
+ console.log(comp);
+ });
+ Alpine.start();
+}
+
+// wait for load until bootstrapped event is received.
+document.addEventListener('firefly-iii-bootstrapped', () => {
+ console.log('Loaded through event listener.');
+ loadPage(comps);
+});
+// or is bootstrapped before event is triggered.
+if (window.bootstrapped) {
+ console.log('Loaded through window variable.');
+ loadPage(comps);
+}
diff --git a/resources/assets/v3/sass/app.scss b/resources/assets/v3/sass/app.scss
index 1c5b0e0483..2b62369917 100644
--- a/resources/assets/v3/sass/app.scss
+++ b/resources/assets/v3/sass/app.scss
@@ -68,6 +68,13 @@ body.waiting * {
.bottom-light-border {border-bottom:1px #aaa solid;}
+/** new classes because of CSP */
+.wide-chart {width:100%;height:400px;}
+.low-chart {width:100%;height:200px;}
+.medium-chart {width:100%;height:250px;}
+.center-chart {width:100%;margin:0 auto;}
+.map-size {width:100%;height:300px;}
+
// @import "admin-lte/dist/css/adminlte.min.css";
diff --git a/resources/assets/v3/vite.config.js b/resources/assets/v3/vite.config.js
index 09d5a0a5c3..124b5f60e1 100644
--- a/resources/assets/v3/vite.config.js
+++ b/resources/assets/v3/vite.config.js
@@ -56,6 +56,9 @@ export default defineConfig(({command, mode, isSsrBuild, isPreview}) => {
// subscriptions
'js/pages/subscriptions/index.js',
+ // transactions
+ 'js/pages/transactions/index.js',
+
// piggy banks
'js/pages/piggy-banks/index.js',
],
diff --git a/resources/views/components/lists/groups-large.blade.php b/resources/views/components/lists/groups-large.blade.php
new file mode 100644
index 0000000000..d8cbddd593
--- /dev/null
+++ b/resources/views/components/lists/groups-large.blade.php
@@ -0,0 +1,460 @@
+<table class="table table-condensed table-hover table-responsive">
+ <thead>
+ <tr>
+ @if($showCategory || $showBudget)
+ <td colspan="7" class="no-margin-pagination">{{ $groups->links('pagination.bootstrap-4') }}</td>
+ @else
+ <td colspan="6" class="no-margin-pagination">{{ $groups->links('pagination.bootstrap-4') }}</td>
+ @endif
+ <td colspan="1" 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">
+ {{ __('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>
+ <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>
+ <span class="txt">{{ __('firefly.bulk_edit') }}</span></a></li>
+ <li><a href="#" class="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>
+ </tr>
+ <tr>
+ <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))
+ <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>
+ @endif
+ @if($showBudget)
+ <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 -->
+ </tr>
+ </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>
+ @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
+ @endif
+ @endforeach
+ </td>
+ <!-- column to span accounts + extra fields -->
+ @if($showCategory || $showBudget)
+ <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>
+ <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>
+ </ul>
+ </div>
+ </td>
+ <td class="top-light-border d-xs-none">&nbsp;</td>
+ </tr>
+ @endif
+ @foreach($group['transactions'] as $index => $transaction)
+ @php $className = ''; @endphp
+ @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 }}">
+ <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
+ </td>
+ <td class="{{ $className }}">
+ @if($transaction['reconciled'])
+ <span class="fa fa-check"></span>
+ @endif
+ @if(count($transaction['attachments']) > 0)
+ <span class="fa fa-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>
+ @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 (fireflyiiiconfig('use_running_balance', true)) %}
+ <td class=" {{ $className }} text-end">
+ {# RUNNING BALANCE #}
+ {% if (null == transaction.balance_dirty or false == transaction.balance_dirty) and null != transaction.destination_balance_after and null != transaction.source_balance_after %}
+ {% if $transaction['transaction_type_type'] == 'Deposit' %}
+ {% 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 $transaction['source_account_type'] == 'Revenue account' %}
+ <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 $transaction['transaction_type_type'] == 'Withdrawal' %}
+ {# withdrawal into a liability #}
+ {% if 'Loan' == transaction.destination_account_type or 'Mortgage' == transaction.destination_account_type or 'Debt' == transaction.destination_account_type %}
+ {% 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 and null != transaction.destination_balance_after and 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 $transaction['transaction_type_type'] == 'Opening balance' %}
+ {% 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 $transaction['transaction_type_type'] == 'Transfer' %}
+ {% 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 %}
+ </td>
+ {% endif %}
+ <td class="{{ $className }}">
+ {{ transaction.date.isoFormat(monthAndDayFormat) }}
+ </td>
+ <td class="{{ $className }}">
+ {% if 'Cash account' == $transaction['source_account_type'] %}
+ <span class="text-success">({{ 'cash'|_ }})</span>
+ {% else %}
+ <a href="{{ route('accounts.show', [$transaction['source_account_id']|default(1)]) }}"
+ title="{{ transaction.source_account_iban|default(transaction.source_account_name) }}">{{ transaction.source_account_name }}</a>
+ {% endif %}
+ </td>
+ <td class="{{ $className }}">
+ {% if 'Cash account' == transaction.destination_account_type %}
+ <span class="text-success">({{ 'cash'|_ }})</span>
+ {% else %}
+ <a href="{{ route('accounts.show', [transaction.destination_account_id|default(1)]) }}"
+ title="{{ transaction.destination_account_iban|default(transaction.destination_account_name) }}">{{ transaction.destination_account_name }}</a>
+ {% endif %}
+ </td>
+ {% if showCategory %}
+ <td class="d-xs-none {{ $className }}">
+ {% if transaction.category_id %}
+ <a href="{{ route('categories.show', [transaction.category_id]) }}"
+ title="{{ transaction.category_name }}">{{ transaction.category_name }}</a>
+ {% endif %}
+ </td>
+ {% endif %}
+ {% if showBudget %}
+ <td class="d-xs-none {{ $className }}">
+ {% if transaction.budget_id %}
+ <a href="{{ route('budgets.show', [transaction.budget_id]) }}"
+ title="{{ transaction.budget_name }}">{{ transaction.budget_name }}</a>
+ {% endif %}
+ </td>
+ {% endif %}
+
+ {% if group.count == 1 %}
+ <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">
+ {{ '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> {{ 'edit'|_ }}</a></li>
+ {% if $transaction['transaction_type_type'] != 'Opening balance' and $transaction['transaction_type_type'] != 'Liability credit' %}
+ <li><a href="{{ route('transactions.delete', [$group->id]) }}"><span
+ class="fa fa-fw fa-trash"></span> {{ '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> {{ 'clone'|_ }}</a></li>
+ <li><a href="#" data-id="{{ $group->id }}" class="clone-transaction-and-edit"><span
+ class="fa fa-copy fa-fw"></span> {{ '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> {{ 'create_rule_from_transaction'|_ }}
+ </a></li>
+ {% endif %}
+ </ul>
+ </div>
+ </td>
+
+ {% endif %}
+ {% if group.count != 1 %}
+ <td class="d-xs-none {{ $className }}">
+ &nbsp;
+ </td>
+ {% 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">
+ <input id="list_{{ transaction.transaction_journal_id }}"
+ value="{{ transaction.transaction_journal_id }}"
+ name="journals[{{ transaction.transaction_journal_id }}]"
+ type="checkbox" class="mass-select form-check-inline"
+ data-value="{{ transaction.transaction_journal_id }}"/>
+ {% endif %}
+ </div>
+ </td>
+ </tr>
+ {% endfor %}
+ @endforeach
+ </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">
+ {{ '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>{{ 'mass_edit'|_ }}</span></a></li>
+ <li><a href="#" class="bulk-edit"><span class="fa fa-fw fa-pencil-square-o"></span>
+ <span>{{ 'bulk_edit'|_ }}</span></a></li>
+ <li><a href="#" class="mass-delete"><span class="fa fa-fw fa-trash"></span>
+ <span>{{ 'mass_delete'|_ }}</span></a></li>
+ </ul>
+ </div>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ {% if showCategory or showBudget %}
+ <td colspan="9" class="no-margin-pagination">{{ $groups->links('pagination.bootstrap-4')|raw }}</td>
+ {% else %}
+ <td colspan="8" class="no-margin-pagination">{{ $groups->links('pagination.bootstrap-4')|raw }}</td>
+ {% endif %}
+ </tr>
+ </tfoot>
+</table>
diff --git a/resources/views/transactions/index.blade.php b/resources/views/transactions/index.blade.php
new file mode 100644
index 0000000000..1e20e2a61c
--- /dev/null
+++ b/resources/views/transactions/index.blade.php
@@ -0,0 +1,133 @@
+@extends('layout.v3.session')
+@section('content')
+
+ {{-- upper show-all instruction --}}
+ @if(count($periods) > 0)
+ <div class="row">
+ {{-- for withdrawals, deposits and transfers --}}
+ <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.categories') }}</h3>
+ </div>
+ <div class="card-body">
+ <canvas id="category_chart" class="medium-chart" height="250"></canvas>
+ </div>
+ </div>
+ </div>
+ {{-- only for withdrawals --}}
+ @if('withdrawal' === $objectType)
+ <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
+ <div class="card mb-2">
+ <div class="card-header">
+ <h3 class="card-title">{{ __('firefly.budgets') }}</h3>
+ </div>
+ <div class="card-body">
+ <canvas id="budget_chart" class="medium-chart" height="250"></canvas>
+ </div>
+ </div>
+ </div>
+ @endif
+ @if('withdrawal' !== $objectType)
+ <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
+ <div class="card mb-2">
+ <div class="card-header with-border">
+ <h3 class="card-title">{{ __('firefly.all_source_accounts') }}</h3>
+ </div>
+ <div class="card-body">
+ <canvas id="source_chart" class="medium-chart" height="250"></canvas>
+ </div>
+ </div>
+ </div>
+ @endif
+ {{-- for all --}}
+ <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
+ <div class="card mb-2">
+ <div class="card-header with-border">
+ <h3 class="card-title">{{ __('firefly.all_destination_accounts') }}</h3>
+ </div>
+ <div class="card-body">
+ <canvas id="destination_chart" class="medium-chart" height="250"></canvas>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="offset-lg-10 col-lg-2 offset-md-10 col-md-2 col-sm-12 col-xs-12">
+ <p class="small text-center"><a href="{{ route('transactions.index.all',[$objectType]) }}">{{ __('firefly.showEverything') }}</a></p>
+ </div>
+ </div>
+ @endif
+
+
+ {{-- list with journals --}}
+ <div class="row">
+ <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>
+ {{-- actual list --}}
+ <x-lists.groups-large :groups="$groups" />
+ </div>
+ <div class="card-footer">
+ {{-- links for other views --}}
+ @if(count($periods) > 0)
+ <p>
+ <span class="fa fa-calendar"></span>
+ <a href="{{ route('transactions.index.all', [$objectType]) }}">{{ __('firefly.show_all_no_filter') }}</a>
+ </p>
+ @else
+ <p>
+ <span class="fa fa-calendar"></span>
+ <a href="{{ route('transactions.index', [$objectType]) }}">{{ __('firefly.show_the_current_period_and_overview') }}</a>
+ </p>
+ @endif
+ </div>
+ </div>
+ </div>
+
+ {{-- boxes with info --}}
+ @if(count($periods) > 0)
+ <div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
+ {% include 'list.periods' %}
+ </div>
+ @endif
+
+ </div>
+
+ {{-- lower show-all instruction --}}
+ @if(count($periods) > 0)
+ <div class="row">
+ <div class="offset-lg-10 col-lg-2 offset-md-10 col-md-2 col-sm-12 col-xs-12">
+ <p class="small text-center"><a href="{{ route('transactions.index.all', [$objectType]) }}">{{ __('firefly.showEverything') }}</a></p>
+ </div>
+ </div>
+ @endif
+
+@endsection
+@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') }}';
+ var cloneAndEditUrl = '{{ route('transactions.clone') }}?redirect=edit';
+ var categoryChartUrl = '{{ route('chart.transactions.categories', [$objectType, $start->format('Y-m-d'), $end->format('Y-m-d')]) }}';
+ var budgetChartUrl = '{{ route('chart.transactions.budgets', [$start->format('Y-m-d'), $end->format('Y-m-d')]) }}';
+ var destinationChartUrl = '{{ route('chart.transactions.destinationAccounts', [$objectType, $start->format('Y-m-d'), $end->format('Y-m-d')]) }}';
+ var sourceChartUrl = '{{ route('chart.transactions.sourceAccounts', [$objectType, $start->format('Y-m-d'), $end->format('Y-m-d')]) }}';
+
+ </script>
+ <script type="text/javascript" src="v1/js/lib/Chart.bundle.min.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
+ <script type="text/javascript" src="v1/js/lib/chartjs-plugin-annotation.min.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
+ <script type="text/javascript" src="v1/js/ff/charts.defaults.js?v={{ $FF_BUILD_TIME }}" nonce="{{ $JS_NONCE }}"></script>
+ <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>
+@endsection
diff --git a/resources/views/transactions/index.twig b/resources/views/transactions/old-index.twig
similarity index 100%
rename from resources/views/transactions/index.twig
rename to resources/views/transactions/old-index.twig