Skip to content

Firefly III: a personal finances manager

Add sum to list.

James Coledd1238bc32b4
diff --git a/resources/assets/v3/js/pages/accounts/index.js b/resources/assets/v3/js/pages/accounts/index.js
index 97e0097a6c..75d47af60a 100644
--- a/resources/assets/v3/js/pages/accounts/index.js
+++ b/resources/assets/v3/js/pages/accounts/index.js
@@ -48,6 +48,9 @@ let index = function () {
pageNavUrl: "./accounts/",
handleFunc: null,
storageKey: "",
+ sums: {},
+ debts: {},
+ formatMoney: formatMoney,
updateHistory() {
if (history.pushState) {
@@ -139,6 +142,7 @@ let index = function () {
let sort = "asc" === this.sortDirection ? this.sortColumn : "-" + this.sortColumn;
let start = window.store.get("start");
let end = window.store.get("end");
+ let convertToPrimary =window.store.get("convert_to_primary");
new Get()
.list({
active: this.active,
@@ -154,23 +158,28 @@ let index = function () {
for (let i = 0; i < response.data.data.length; i++) {
if (Object.hasOwn(response.data.data, i)) {
let current = response.data.data[i];
- let balanceDifference = formatMoney(
- current.attributes.balance_difference,
- current.attributes.currency_code,
- true,
- );
+
+ // collect sums and debts for each account (in primary or not):
+ this.sums[current.attributes.currency_code] = this.sums[current.attributes.currency_code] || 0;
+ this.sums[current.attributes.primary_currency_code] = this.sums[current.attributes.primary_currency_code] || 0;
+ this.debts[current.attributes.currency_code] = this.debts[current.attributes.currency_code] || 0;
+ this.debts[current.attributes.primary_currency_code] = this.debts[current.attributes.primary_currency_code] || 0;
+
+ let balanceDifference = formatMoney(current.attributes.balance_difference, current.attributes.currency_code, true,);
let balanceDiffFloat = parseFloat(current.attributes.balance_difference);
- let currentBalance = formatMoney(
- current.attributes.current_balance,
- current.attributes.currency_code,
- );
+ let currentBalance = formatMoney(current.attributes.current_balance, current.attributes.currency_code,);
+
let currentBalanceFloat = parseFloat(current.attributes.current_balance);
- let currentDebt = formatMoney(
- current.attributes.debt_amount,
- current.attributes.currency_code,
- );
+ let currentDebt = formatMoney(current.attributes.debt_amount, current.attributes.currency_code,);
let currentDebtFloat = parseFloat(current.attributes.debt_amount);
- if (window.store.get("convert_to_primary")) {
+
+ // this.sums[current.attributes.currency_code] += currentBalanceFloat;
+ if(!convertToPrimary) {
+ this.sums[current.attributes.currency_code] += currentBalanceFloat;
+ this.debts[current.attributes.currency_code] += currentDebtFloat;
+ }
+ if (convertToPrimary) {
+
balanceDifference = formatMoney(
current.attributes.pc_balance_difference,
current.attributes.primary_currency_code,
@@ -187,6 +196,8 @@ let index = function () {
current.attributes.primary_currency_code,
);
currentDebtFloat = parseFloat(current.attributes.pc_debt_amount);
+ this.sums[current.attributes.primary_currency_code] += currentBalanceFloat;
+ this.debts[current.attributes.primary_currency_code] += currentDebtFloat;
}
let lastActivity = this.formatDate(current.attributes.last_activity);
let noLastActivity = false;
diff --git a/resources/views/accounts/index.blade.php b/resources/views/accounts/index.blade.php
index 4f47772fa8..6c564180b7 100644
--- a/resources/views/accounts/index.blade.php
+++ b/resources/views/accounts/index.blade.php
@@ -1,7 +1,7 @@
@extends('layout.v3.session')
@section('content')
- <div class="row" x-data="index">
- <template x-if="true === loadingPage">
+ <div class="row" x-data="index">
+ <template x-if="true === loadingPage">
<div class="col-lg-12 text-center">
<div id="status-box" class="p-3 install-box-border">
<div class="spinner-border spinner-border-sm" role="status">
@@ -9,74 +9,93 @@
</div>
</div>
</div>
- </template>
+ </template>
- <div class="col-lg-12 col-md-12 col-sm-12 data-holder">
- <div class="card" id="account-index-{{ $objectType }}">
- <x-elements.card-header-with-menu :cardTitle="trans('firefly.'.$objectType.'_accounts')" :route="route('accounts.create', $objectType) . '?_from=' . urlencode($FF3_FROM)" :linkTitle="__('firefly.make_new_'. $objectType . '_account')"/>
- <div class="card-body p-0">
- <x-elements.alpine.page-navigation />
- <div class="p-3 text-center" x-show="true === loadingNewSort">
- <div class="spinner-border spinner-border-sm" role="status">
- <span class="visually-hidden">{{ __('firefly.thinking') }}</span>
- </div>
+ <div class="col-lg-12 col-md-12 col-sm-12 data-holder">
+ <div class="card" id="account-index-{{ $objectType }}">
+ <x-elements.card-header-with-menu :cardTitle="trans('firefly.'.$objectType.'_accounts')"
+ :route="route('accounts.create', $objectType) . '?_from=' . urlencode($FF3_FROM)"
+ :linkTitle="__('firefly.make_new_'. $objectType . '_account')"/>
+ <div class="card-body p-0">
+ <x-elements.alpine.page-navigation/>
+ <div class="p-3 text-center" x-show="true === loadingNewSort">
+ <div class="spinner-border spinner-border-sm" role="status">
+ <span class="visually-hidden">{{ __('firefly.thinking') }}</span>
</div>
- <table class="table table-valign-middle table-sm table-hover sortable">
- <thead>
- <tr>
- <th data-column="order" :class="{'w-5' : true,'sortable': true, 'sortable_sorted': 'order' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">&nbsp;</th>
- <th data-column="name" :class="{'w-20' : true,'sortable': true, 'sortable_sorted': 'name' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.name') }}</th>
+ </div>
+ <table class="table table-bordered table-valign-middle table-sm table-hover sortable">
+ <thead>
+ <tr>
+ <th data-column="order"
+ :class="{'w-5' : true,'sortable': true, 'sortable_sorted': 'order' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">
+ &nbsp;
+ </th>
+ <th data-column="name"
+ :class="{'w-20' : true,'sortable': true, 'sortable_sorted': 'name' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.name') }}</th>
+ <template x-if="'asset' === objectType">
+ {{-- hide on LG and smaller. --}}
+ <th data-column="role"
+ :class="{'d-lg-table-cell': true, 'd-none': true,'sortable': true, 'sortable_sorted': 'role' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.role') }}</th>
+ </template>
+ <template x-if="'liabilities' === objectType">
+ <th data-column="account_type_id"
+ :class="{'sortable': true, 'sortable_sorted': 'account_type_id' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.liability_type') }}</th>
+ </template>
+ <template x-if="'liabilities' === objectType">
+ <th data-column="liability_direction"
+ :class="{'sortable': true, 'sortable_sorted': 'liability_direction' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('form.liability_direction') }}</th>
+ </template>
+ <template x-if="'liabilities' === objectType">
+ <th data-column="liability_interest"
+ :class="{'sortable': true, 'sortable_sorted': 'liability_interest' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.interest') }}
+ ({{ trans('list.interest_period') }})
+ </th>
+ </template>
+ <th data-column="account_number_and_iban"
+ :class="{'sortable': true, 'sortable_sorted': 'account_number_and_iban' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('form.account_number') }}</th>
+ <template x-if="'liabilities' !== objectType">
+ <th data-column="current_balance"
+ :class="{'text-end': true, 'sortable': true, 'sortable_sorted': 'current_balance' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.currentBalance') }}</th>
+ </template>
+ <template x-if="'liabilities' === objectType">
+ <th data-column="debt_amount"
+ :class="{'text-end': true, 'sortable': true, 'sortable_sorted': 'debt_amount' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">
+ {{ trans('firefly.left_in_debt') }}
+ </th>
+ </template>
+ <th {{-- hide on SM --}} class="d-md-table-cell d-none">{{ trans('list.active') }}</th>
+ {{-- hide last activity to make room for other stuff --}}
+ <template x-if="'liabilities' !== objectType">
+ {{-- hide on LG and smaller. --}}
+ <th data-column="last_activity"
+ :class="{'d-lg-table-cell': true, 'd-none': true, 'sortable': true, 'sortable_sorted': 'last_activity' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.lastActivity') }}</th>
+ </template>
+ {{-- hide on SM --}}
+ <th data-column="balance_difference"
+ :class="{'w-15': true,'text-end': true, 'd-lg-table-cell': true, 'd-none': true, 'sortable': true, 'sortable_sorted': 'balance_difference' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.balanceDiff') }}</th>
+ <th>&nbsp;</th>
+ </tr>
+ </thead>
+ <tbody>
+ <template x-for="account in accounts" :key="account.id">
+ <tr :data-id="account.id">
+ <td>
+ <template
+ x-if="('asset' === objectType || 'liabilities' === objectType) && 'asc' === sortDirection && 'order' === sortColumn && accounts.length > 1">
+ <span class="btn btn-outline-secondary btn-sm bi bi-list object-handle"></span>
+ </template>
+ </td>
+ <td>
+ <a :href="'./accounts/show/' + account.id" :title="account.name"
+ x-text="account.name"></a>
+ <template x-if="account.location">
+ <span class="bi bi-map"></span>
+ </template>
+ <template x-if="true === account.has_attachments">
+ <span class="bi bi-paperclip"></span>
+ </template>
+ </td>
<template x-if="'asset' === objectType">
- {{-- hide on LG and smaller. --}}
- <th data-column="role" :class="{'d-lg-table-cell': true, 'd-none': true,'sortable': true, 'sortable_sorted': 'role' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.role') }}</th>
- </template>
- <template x-if="'liabilities' === objectType">
- <th data-column="account_type_id" :class="{'sortable': true, 'sortable_sorted': 'account_type_id' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.liability_type') }}</th>
- </template>
- <template x-if="'liabilities' === objectType">
- <th data-column="liability_direction" :class="{'sortable': true, 'sortable_sorted': 'liability_direction' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('form.liability_direction') }}</th>
- </template>
- <template x-if="'liabilities' === objectType">
- <th data-column="liability_interest" :class="{'sortable': true, 'sortable_sorted': 'liability_interest' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.interest') }} ({{ trans('list.interest_period') }})</th>
- </template>
- <th data-column="account_number_and_iban" :class="{'sortable': true, 'sortable_sorted': 'account_number_and_iban' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('form.account_number') }}</th>
- <template x-if="'liabilities' !== objectType">
- <th data-column="current_balance" :class="{'text-end': true, 'sortable': true, 'sortable_sorted': 'current_balance' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.currentBalance') }}</th>
- </template>
- <template x-if="'liabilities' === objectType">
- <th data-column="debt_amount" :class="{'text-end': true, 'sortable': true, 'sortable_sorted': 'debt_amount' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">
- {{ trans('firefly.left_in_debt') }}
- </th>
- </template>
- <th {{-- hide on SM --}} class="d-md-table-cell d-none">{{ trans('list.active') }}</th>
- {{-- hide last activity to make room for other stuff --}}
- <template x-if="'liabilities' !== objectType">
- {{-- hide on LG and smaller. --}}
- <th data-column="last_activity" :class="{'d-lg-table-cell': true, 'd-none': true, 'sortable': true, 'sortable_sorted': 'last_activity' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.lastActivity') }}</th>
- </template>
- {{-- hide on SM --}}
- <th data-column="balance_difference" :class="{'w-15': true,'text-end': true, 'd-lg-table-cell': true, 'd-none': true, 'sortable': true, 'sortable_sorted': 'balance_difference' === sortColumn, 'sortable_sorted_asc': 'asc' === sortDirection, 'sortable_sorted_desc': 'desc' === sortDirection }">{{ trans('list.balanceDiff') }}</th>
- <th>&nbsp;</th>
- </tr>
- </thead>
- <tbody>
- <template x-for="account in accounts" :key="account.id">
- <tr :data-id="account.id">
- <td>
- <template x-if="('asset' === objectType || 'liabilities' === objectType) && 'asc' === sortDirection && 'order' === sortColumn && accounts.length > 1">
- <span class="btn btn-outline-secondary btn-sm bi bi-list object-handle"></span>
- </template>
- </td>
- <td>
- <a :href="'./accounts/show/' + account.id" :title="account.name" x-text="account.name"></a>
- <template x-if="account.location">
- <span class="bi bi-map"></span>
- </template>
- <template x-if="true === account.has_attachments">
- <span class="bi bi-paperclip"></span>
- </template>
- </td>
- <template x-if="'asset' === objectType">
<td class="d-lg-table-cell d-none">
<template x-if="null !== account.role">
<span x-text="i18next.t('firefly.account_role_' + account.role)"></span>
@@ -85,30 +104,30 @@
<span>~</span>
</template>
</td>
- </template>
- <template x-if="'liabilities' === objectType">
+ </template>
+ <template x-if="'liabilities' === objectType">
<td>
<span x-text="account.liability_type"></span>
</td>
- </template>
- <template x-if="'liabilities' === objectType">
+ </template>
+ <template x-if="'liabilities' === objectType">
<td>
<span x-text="account.liability_direction"></span>
</td>
- </template>
- <template x-if="'liabilities' === objectType">
+ </template>
+ <template x-if="'liabilities' === objectType">
<td>
<span x-text="account.liability_interest"></span>%
(<span x-text="account.liability_interest_period"></span>)
</td>
+ </template>
+ <td>
+ <span x-text="account.iban"></span>
+ <template x-if="'' === account.iban">
+ <span x-text="account.account_number"></span>
</template>
- <td>
- <span x-text="account.iban"></span>
- <template x-if="'' === account.iban">
- <span x-text="account.account_number"></span>
- </template>
- </td>
- <template x-if="'liabilities' !== objectType">
+ </td>
+ <template x-if="'liabilities' !== objectType">
<td class="text-end">
<template x-if="0.0 === account.current_balance_float">
<span class="money-neutral" x-text="account.current_balance"></span>
@@ -120,8 +139,8 @@
<span class="money-negative" x-text="account.current_balance"></span>
</template>
</td>
- </template>
- <template x-if="'liabilities' === objectType">
+ </template>
+ <template x-if="'liabilities' === objectType">
<td class="text-end">
<template x-if="0.0 === account.current_debt_float">
<span class="money-neutral" x-text="account.current_debt"></span>
@@ -133,16 +152,16 @@
<span class="money-negative" x-text="account.current_debt"></span>
</template>
</td>
+ </template>
+ <td class="d-md-table-cell d-none">
+ <template x-if="true === account.active">
+ <span class="bi bi-check text-success"></span>
</template>
- <td class="d-md-table-cell d-none">
- <template x-if="true === account.active">
- <span class="bi bi-check text-success"></span>
- </template>
- <template x-if="false === account.active">
- <span class="bi bi-x text-danger"></span>
- </template>
- </td>
- <template x-if="'liabilities' !== objectType">
+ <template x-if="false === account.active">
+ <span class="bi bi-x text-danger"></span>
+ </template>
+ </td>
+ <template x-if="'liabilities' !== objectType">
<td>
<template x-if="true === account.no_last_activity">
<em class="text-muted" x-text="account.last_activity"></em>
@@ -151,82 +170,136 @@
<span x-text="account.last_activity"></span>
</template>
</td>
+ </template>
+ <td class="text-end">
+ <template x-if="0.0 === account.balance_difference_float">
+ <span class="money-neutral" x-text="account.balance_difference"></span>
</template>
- <td class="text-end">
- <template x-if="0.0 === account.balance_difference_float">
- <span class="money-neutral" x-text="account.balance_difference"></span>
- </template>
- <template x-if="account.balance_difference_float > 0.0">
- <span class="money-positive" x-text="account.balance_difference"></span>
- </template>
- <template x-if="account.balance_difference_float < 0.0">
- <span class="money-negative" x-text="account.balance_difference"></span>
- </template>
- </td>
- <td class="justify-content-end">
- <div class="dropdown">
- <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">
- <li><a class="dropdown-item" :href="'./accounts/edit/' + account.id + '?_from={{ urlencode($FF3_FROM) }}'"><span class="bi bi-pencil"></span> {{ __('firefly.edit') }}</a></li>
- <li><a class="dropdown-item" :href="'./accounts/delete/' + account.id + '?_from={{ urlencode($FF3_FROM) }}'"><span class="bi bi-trash"></span> {{ __('firefly.delete') }}</a></li>
- <template x-if="'asset' === objectType">
- <li><a class="dropdown-item" :href="'./accounts/reconcile/' + account.id + '/index'"><span class="bi bi-check"></span> {{ __('firefly.reconcile_this_account') }}</a></li>
- </template>
- </ul>
- </div>
- </td>
- </tr>
- </template>
- </tbody>
- </table>
+ <template x-if="account.balance_difference_float > 0.0">
+ <span class="money-positive" x-text="account.balance_difference"></span>
+ </template>
+ <template x-if="account.balance_difference_float < 0.0">
+ <span class="money-negative" x-text="account.balance_difference"></span>
+ </template>
+ </td>
+ <td class="justify-content-end">
+ <div class="dropdown">
+ <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">
+ <li><a class="dropdown-item"
+ :href="'./accounts/edit/' + account.id + '?_from={{ urlencode($FF3_FROM) }}'"><span
+ class="bi bi-pencil"></span> {{ __('firefly.edit') }}</a></li>
+ <li><a class="dropdown-item"
+ :href="'./accounts/delete/' + account.id + '?_from={{ urlencode($FF3_FROM) }}'"><span
+ class="bi bi-trash"></span> {{ __('firefly.delete') }}</a></li>
+ <template x-if="'asset' === objectType">
+ <li><a class="dropdown-item"
+ :href="'./accounts/reconcile/' + account.id + '/index'"><span
+ class="bi bi-check"></span> {{ __('firefly.reconcile_this_account') }}
+ </a></li>
+ </template>
+ </ul>
+ </div>
+ </td>
+ </tr>
+ </template>
+ </tbody>
+ <template
+ x-if="accounts.length > 0 && ('asset' === objectType || 'liabilities' === objectType)">
+ <tfoot>
+ <tr>
+ <td colspan="3">&nbsp;</td>
+ <template x-if="'asset' === objectType">
+ <td>&nbsp;</td>
+ </template>
+ <template x-if="'liabilities' === objectType">
+ <td colspan="3">&nbsp;</td>
+ </template>
+ <td class="text-end">
+ <template x-for="(sum, code) in sums">
+ <span>
+ <template x-if="sum > 0">
+ <span>
+ <span class="money-positive" x-text="formatMoney(sum, code)"></span>
+ <br>
+ </span>
+ </template>
+ <template x-if="sum < 0">
+ <span>
+ <span class="money-negative" x-text="formatMoney(sum, code)"></span>
+ <br>
+ </span>
+ </template>
- <template x-if="totalPages > 1">
- <x-elements.alpine.page-navigation />
+ </span>
+ </template>
+ </td>
+ <template x-if="'liabilities' === objectType">
+ <td colspan="3">&nbsp;</td>
+ </template>
+ <template x-if="'liabilities' !== objectType">
+ <td colspan="4">&nbsp;</td>
+ </template>
+ </tr>
+ </tfoot>
</template>
- </div>
- <x-elements.card-footer-with-menu :route="route('accounts.create', $objectType) . '?_from=' . urlencode($FF3_FROM)" :linkTitle="__('firefly.make_new_'. $objectType . '_account')" />
+ </table>
+
+ <template x-if="totalPages > 1">
+ <x-elements.alpine.page-navigation/>
+ </template>
</div>
+ <x-elements.card-footer-with-menu
+ :route="route('accounts.create', $objectType) . '?_from=' . urlencode($FF3_FROM)"
+ :linkTitle="__('firefly.make_new_'. $objectType . '_account')"/>
</div>
- <template x-if="0 === accounts.length && true === active && false === loadingPage">
- <x-empty-page :route="route('accounts.create', [$objectType]) . '?_from=' . urlencode($FF3_FROM)" type="accounts" :object-type="$objectType" />
- </template>
- <template x-if="0 === accounts.length && true === active">
- <p class="text-center"><small>
- <em>
- <span x-text="i18next.t('firefly.may_inactive_accounts_link', {url: '{{ route('accounts.inactive.index', $objectType) }}'})"></span>
- </em>
- </small>
- </p>
- </template>
- <template x-if="0 !== accounts.length && true === active">
- <p class="text-center"><small>
- <em>
- <a href="{{ route('accounts.inactive.index', $objectType) }}">
- <span x-text="i18next.t('firefly.inactive_account_link_js')"></span>
- </a>
- </em>
- </small>
- </p>
- </template>
- <template x-if="0 !== accounts.length && false === active">
- <p class="text-center"><small>
- <em>
- <a href="{{ route('accounts.index', $objectType) }}"><span x-text="i18next.t('firefly.active_account_link')"></span></a>
- </em>
- </small>
- </p>
- </template>
- <template x-if="0 === accounts.length && false === active">
- <p class="text-center"><small>
- <em>
- <span x-text="i18next.t('firefly.no_inactive_accounts', {url: '{{ route('accounts.index', $objectType) }}'})"></span>
- </em>
- </small>
- </p>
- </template>
</div>
+ <template x-if="0 === accounts.length && true === active && false === loadingPage">
+ <x-empty-page :route="route('accounts.create', [$objectType]) . '?_from=' . urlencode($FF3_FROM)"
+ type="accounts" :object-type="$objectType"/>
+ </template>
+ <template x-if="0 === accounts.length && true === active">
+ <p class="text-center"><small>
+ <em>
+ <span
+ x-text="i18next.t('firefly.may_inactive_accounts_link', {url: '{{ route('accounts.inactive.index', $objectType) }}'})"></span>
+ </em>
+ </small>
+ </p>
+ </template>
+ <template x-if="0 !== accounts.length && true === active">
+ <p class="text-center"><small>
+ <em>
+ <a href="{{ route('accounts.inactive.index', $objectType) }}">
+ <span x-text="i18next.t('firefly.inactive_account_link_js')"></span>
+ </a>
+ </em>
+ </small>
+ </p>
+ </template>
+ <template x-if="0 !== accounts.length && false === active">
+ <p class="text-center"><small>
+ <em>
+ <a href="{{ route('accounts.index', $objectType) }}"><span
+ x-text="i18next.t('firefly.active_account_link')"></span></a>
+ </em>
+ </small>
+ </p>
+ </template>
+ <template x-if="0 === accounts.length && false === active">
+ <p class="text-center"><small>
+ <em>
+ <span
+ x-text="i18next.t('firefly.no_inactive_accounts', {url: '{{ route('accounts.index', $objectType) }}'})"></span>
+ </em>
+ </small>
+ </p>
+ </template>
+ </div>
@endsection
@section('scripts')
@vite(['js/pages/accounts/index.js'])