Improve account list and view.

This commit is contained in:
James Cole
2025-08-31 19:20:02 +02:00
parent d959526eb3
commit 1e7ea4b76c
8 changed files with 154 additions and 67 deletions

View File

@@ -32,6 +32,7 @@ import {showWizardButton} from "../../support/page-settings/show-wizard-button.j
import {setVariable} from "../../store/set-variable.js";
import {getVariables} from "../../store/get-variables.js";
import pageNavigation from "../../support/page-navigation.js";
import {getVariable} from "../../store/get-variable.js";
// set type from URL
@@ -56,12 +57,12 @@ if(sortingColumn[0] === '-') {
page = parseInt(params.page ?? 1);
showInternalsButton();
showWizardButton();
// TODO currency conversion
// TODO page cleanup and recycle for transaction lists.
// TODO process startPeriod and endPeriod.
let index = function () {
return {
@@ -73,9 +74,9 @@ let index = function () {
show: false, text: '', url: '',
}, wait: {
show: false, text: '',
}
},
convertToPrimary: false,
totalPages: 1,
page: 1,
pageUrl: '',
@@ -259,6 +260,7 @@ let index = function () {
{name: this.getPreferenceKey('sd'), default: ''},
{name: this.getPreferenceKey('filters'), default: this.filters},
{name: this.getPreferenceKey('grouped'), default: true},
{name: 'convert_to_primary', default: false},
]).then((res) => {
// process columns:
for (let k in res[0]) {
@@ -283,6 +285,9 @@ let index = function () {
// group accounts
this.pageOptions.groupedAccounts = res[4];
// convert to primary?
this.convertToPrimary = res[5];
this.loadAccounts();
});
},
@@ -348,7 +353,6 @@ let index = function () {
if('asc' === this.pageOptions.sortDirection && '' !== sorting) {
sorting = '-' + sorting;
}
//const sorting = [{column: this.pageOptions.sortingColumn, direction: this.pageOptions.sortDirection}];
// filter instructions
let filters = {};
@@ -371,20 +375,20 @@ let index = function () {
sort: sorting,
filter: filters,
active: active,
currentMoment: today,
date: format(today,'yyyy-MM-dd'),
type: type,
page: this.page,
startPeriod: start,
endPeriod: end
// startPeriod: start,
// endPeriod: end
};
if (!this.tableColumns.balance_difference.enabled) {
delete params.startPeriod;
delete params.endPeriod;
// delete params.startPeriod;
// delete params.endPeriod;
}
this.accounts = [];
let groupedAccounts = {};
// one page only.o
// one page only
(new Get()).index(params).then(response => {
this.totalPages = response.meta.pagination.total_pages;
for (let i = 0; i < response.data.length; i++) {
@@ -406,9 +410,9 @@ let index = function () {
liability_direction: current.attributes.liability_direction,
interest: current.attributes.interest,
interest_period: current.attributes.interest_period,
balance: current.attributes.balance,
pc_balance: current.attributes.pc_balance,
balances: current.attributes.balances,
// balance: current.attributes.balance,
// pc_balance: current.attributes.pc_balance,
// balances: current.attributes.balances,
};
// get group info:
let groupId = current.attributes.object_group_id;
@@ -426,10 +430,9 @@ let index = function () {
}
}
groupedAccounts[groupId].accounts.push(account);
//this.accounts.push(account);
}
}
// order grouped accounts by order.
let sortable = [];
for (let set in groupedAccounts) {

View File

@@ -119,6 +119,7 @@ return [
'between.file' => 'The :attribute must be between :min and :max kilobytes.',
'between.string' => 'The :attribute must be between :min and :max characters.',
'between.array' => 'The :attribute must have between :min and :max items.',
'between_date' => 'The date must be between the given start and end date.',
'boolean' => 'The :attribute field must be true or false.',
'confirmed' => 'The :attribute confirmation does not match.',
'date' => 'The :attribute is not a valid date.',

View File

@@ -441,7 +441,7 @@
<td>
{% for tag in journal.tags %}
<h4 style="display: inline;"><a class="label label-success"
href="{{ route('tags.show', tag.id) }}">
href="{{ route('tags.show', [tag.id]) }}">
<span class="fa fa-fw fa-tag"></span>{{ tag.tag }}</a>
</h4>
{% endfor %}

View File

@@ -10,7 +10,7 @@
<h3 class="card-title">{{ __('firefly.net_worth') }}</h3>
</div>
<div class="card-body">
TODO
Not yet implemented.
</div>
</div>
</div>
@@ -20,17 +20,17 @@
<h3 class="card-title">{{ __('firefly.in_out_period') }}</h3>
</div>
<div class="card-body">
TODO
Not yet implemented.
</div>
</div>
</div>
<div class="col-xl-4 col-lg-6 col-md-12 col-sm-12 col-xs-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">TODO</h3>
<h3 class="card-title">Not yet implemented.</h3>
</div>
<div class="card-body">
TODO
Not yet implemented.
</div>
</div>
</div>
@@ -262,17 +262,14 @@
</template>
</td>
<td x-show="tableColumns.current_balance.visible && tableColumns.current_balance.enabled">
<template x-if="null !== account.balance">
<template x-for="balance in account.balance">
<span>
<span x-show="parseFloat(balance.balance) < 0.0" class="text-danger"
x-text="formatMoney(balance.balance, balance.currency_code)"></span>
<span x-show="parseFloat(balance.balance) === 0.0" class="text-muted"
x-text="formatMoney(balance.balance, balance.currency_code)"></span>
<span x-show="parseFloat(balance.balance) > 0.0" class="text-success"
x-text="formatMoney(balance.balance, balance.currency_code)"></span>
</span>
</template>
<span x-show="parseFloat(account.current_balance) < 0.0" class="text-danger"
x-text="formatMoney(account.current_balance, account.currency_code)"></span>
<span x-show="parseFloat(account.current_balance) === 0.0" class="text-muted"
x-text="formatMoney(account.current_balance, account.currency_code)"></span>
<span x-show="parseFloat(account.current_balance) > 0.0" class="text-success"
x-text="formatMoney(account.current_balance, account.currency_code)"></span>
<template x-if="null !== account.pc_current_balance">
<span>PC current balance TODO.</span>
</template>
</td>
<td x-show="tableColumns.amount_due.visible && tableColumns.amount_due.enabled">