mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-20 03:10:57 +00:00
Fix most of the index with json laravel api endpoints.
This commit is contained in:
@@ -48,7 +48,12 @@ const params = new Proxy(new URLSearchParams(window.location.search), {
|
||||
get: (searchParams, prop) => searchParams.get(prop),
|
||||
});
|
||||
sortingColumn = params.column ?? '';
|
||||
sortDirection = params.direction ?? '';
|
||||
sortDirection = 'asc';
|
||||
if(sortingColumn[0] === '-') {
|
||||
sortingColumn = sortingColumn.substring(1);
|
||||
sortDirection = 'desc';
|
||||
}
|
||||
|
||||
page = parseInt(params.page ?? 1);
|
||||
|
||||
|
||||
@@ -77,6 +82,7 @@ let index = function () {
|
||||
filters: {
|
||||
active: null,
|
||||
name: null,
|
||||
type: type,
|
||||
},
|
||||
pageOptions: {
|
||||
isLoading: true,
|
||||
@@ -345,10 +351,11 @@ let index = function () {
|
||||
//const sorting = [{column: this.pageOptions.sortingColumn, direction: this.pageOptions.sortDirection}];
|
||||
|
||||
// filter instructions
|
||||
let filters = [];
|
||||
let filters = {};
|
||||
for (let k in this.filters) {
|
||||
if (this.filters.hasOwnProperty(k) && null !== this.filters[k]) {
|
||||
filters.push({column: k, filter: this.filters[k]});
|
||||
filters[k] = this.filters[k];
|
||||
//filters.push({column: k, filter: this.filters[k]});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,9 +365,9 @@ let index = function () {
|
||||
const today = new Date();
|
||||
|
||||
let params = {
|
||||
sorting: sorting,
|
||||
filters: filters,
|
||||
// today: today,
|
||||
sort: sorting,
|
||||
filter: filters,
|
||||
currentMoment: today,
|
||||
// type: type,
|
||||
page: {number: this.page},
|
||||
startPeriod: start,
|
||||
@@ -368,8 +375,8 @@ let index = function () {
|
||||
};
|
||||
|
||||
if (!this.tableColumns.balance_difference.enabled) {
|
||||
delete params.start;
|
||||
delete params.end;
|
||||
delete params.startPeriod;
|
||||
delete params.enPeriod;
|
||||
}
|
||||
this.accounts = [];
|
||||
let groupedAccounts = {};
|
||||
@@ -404,7 +411,6 @@ let index = function () {
|
||||
balance: current.attributes.balance,
|
||||
native_balance: current.attributes.native_balance,
|
||||
};
|
||||
|
||||
// get group info:
|
||||
let groupId = current.attributes.object_group_id;
|
||||
if(!this.pageOptions.groupedAccounts) {
|
||||
|
@@ -125,12 +125,12 @@
|
||||
{{ __('list.interest') }}
|
||||
</th>
|
||||
<th x-show="tableColumns.number.visible && tableColumns.number.enabled">
|
||||
<a href="#" x-on:click.prevent="sort('iban')">
|
||||
<a href="#" x-on:click.prevent="sort('account_number')">
|
||||
{{ __('list.account_number') }}
|
||||
</a>
|
||||
<em x-show="pageOptions.sortingColumn === 'iban' && pageOptions.sortDirection === 'asc'"
|
||||
<em x-show="pageOptions.sortingColumn === 'account_number' && pageOptions.sortDirection === 'asc'"
|
||||
class="fa-solid fa-arrow-down-a-z"></em>
|
||||
<em x-show="pageOptions.sortingColumn === 'iban' && pageOptions.sortDirection === 'desc'"
|
||||
<em x-show="pageOptions.sortingColumn === 'account_number' && pageOptions.sortDirection === 'desc'"
|
||||
class="fa-solid fa-arrow-down-z-a"></em>
|
||||
</th>
|
||||
<th x-show="tableColumns.current_balance.visible && tableColumns.current_balance.enabled">
|
||||
@@ -262,13 +262,17 @@
|
||||
</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 x-show="balance.balance < 0" class="text-danger"
|
||||
<span>
|
||||
<span x-show="parseFloat(balance.balance) < 0.0" class="text-danger"
|
||||
x-text="formatMoney(balance.balance, balance.currency_code)"></span>
|
||||
<span x-show="balance.balance == 0" class="text-muted"
|
||||
<span x-show="parseFloat(balance.balance) === 0.0" class="text-muted"
|
||||
x-text="formatMoney(balance.balance, balance.currency_code)"></span>
|
||||
<span x-show="balance.balance > 0" class="text-success"
|
||||
<span x-show="parseFloat(balance.balance) > 0.0" class="text-success"
|
||||
x-text="formatMoney(balance.balance, balance.currency_code)"></span>
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
</td>
|
||||
<td x-show="tableColumns.amount_due.visible && tableColumns.amount_due.enabled">
|
||||
@@ -284,14 +288,17 @@
|
||||
<span x-text="account.last_activity"></span>
|
||||
</td>
|
||||
<td x-show="tableColumns.balance_difference.visible && tableColumns.balance_difference.enabled">
|
||||
|
||||
<template x-if="null !== account.balance">
|
||||
<template x-for="balance in account.balance">
|
||||
<span>
|
||||
<span x-show="null != balance.balance_difference && balance.balance_difference < 0" class="text-danger"
|
||||
x-text="formatMoney(balance.balance_difference, balance.currency_code)"></span>
|
||||
<span x-show="null != balance.balance_difference && balance.balance_difference == 0" class="text-muted"
|
||||
x-text="formatMoney(balance.balance_difference, balance.currency_code)"></span>
|
||||
<span x-show="null != balance.balance_difference && balance.balance_difference > 0" class="text-success"
|
||||
x-text="formatMoney(balance.balance_difference, balance.currency_code)"></span>
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
</td>
|
||||
<td x-show="tableColumns.menu.visible && tableColumns.menu.enabled">
|
||||
|
Reference in New Issue
Block a user