Fix columns, improve views.

This commit is contained in:
James Cole
2025-09-01 20:39:40 +02:00
parent ad77d55c16
commit 26a8bd921d
6 changed files with 235 additions and 146 deletions

View File

@@ -378,8 +378,8 @@ let index = function () {
date: format(today,'yyyy-MM-dd'),
type: type,
page: this.page,
// startPeriod: start,
// endPeriod: end
start: start,
end: end
};
if (!this.tableColumns.balance_difference.enabled) {
@@ -403,17 +403,26 @@ let index = function () {
role: current.attributes.account_role,
iban: null === current.attributes.iban ? '' : current.attributes.iban.match(/.{1,4}/g).join(' '),
account_number: null === current.attributes.account_number ? '' : current.attributes.account_number,
current_balance: current.attributes.current_balance,
currency_code: current.attributes.currency_code,
last_activity: null === current.attributes.last_activity ? '' : format(new Date(current.attributes.last_activity), i18next.t('config.month_and_day_fns')),
liability_type: current.attributes.liability_type,
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,
// currency info
currency_code: current.attributes.currency_code,
primary_currency_code: current.attributes.primary_currency_code,
// balances.
current_balance: current.attributes.current_balance,
pc_current_balance: current.attributes.pc_current_balance,
balance_difference: current.attributes.balance_difference,
pc_balance_difference: current.attributes.pc_balance_difference,
debt_amount: current.attributes.debt_amount,
pc_debt_amount: current.attributes.debt_amount,
};
console.log(account);
// get group info:
let groupId = current.attributes.object_group_id;
if(!this.pageOptions.groupedAccounts) {

View File

@@ -263,39 +263,74 @@
</td>
<td x-show="tableColumns.current_balance.visible && tableColumns.current_balance.enabled">
<span x-show="parseFloat(account.current_balance) < 0.0" class="text-danger"
x-text="formatMoney(account.current_balance, account.currency_code)"></span>
x-text="formatMoney(account.current_balance, account.primary_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>
x-text="formatMoney(account.current_balance, account.primary_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>
x-text="formatMoney(account.current_balance, account.primary_currency_code)"></span>
<template x-if="null !== account.pc_current_balance">
<span>PC current balance TODO.</span>
<span>(
<span x-show="parseFloat(account.pc_current_balance) < 0.0" class="text-danger"
x-text="formatMoney(account.pc_current_balance, account.primary_currency_code)"></span>
<span x-show="parseFloat(account.pc_current_balance) === 0.0" class="text-muted"
x-text="formatMoney(account.pc_current_balance, account.primary_currency_code)"></span>
<span x-show="parseFloat(account.pc_current_balance) > 0.0" class="text-success"
x-text="formatMoney(account.pc_current_balance, account.primary_currency_code)"></span>
)
</span>
</template>
</td>
<td x-show="tableColumns.amount_due.visible && tableColumns.amount_due.enabled">
<!--
<template x-if="null !== account.current_debt">
<span class="text-info"
x-text="formatMoney(account.current_debt, account.currency_code)"></span>
<template x-if="null !== account.debt_amount">
<span>
<span x-show="null != account.debt_amount && account.debt_amount < 0" class="text-danger"
x-text="formatMoney(account.debt_amount, account.currency_code)"></span>
<span x-show="null != account.debt_amount && account.debt_amount == 0" class="text-muted"
x-text="formatMoney(account.debt_amount, account.currency_code)"></span>
<span x-show="null != account.debt_amount && account.debt_amount > 0" class="text-success"
x-text="formatMoney(account.debt_amount, account.currency_code)"></span>
</span>
<template x-if="null !== account.pc_debt_amount">
<span>(
<span x-show="parseFloat(account.pc_debt_amount) < 0.0" class="text-danger"
x-text="formatMoney(account.pc_debt_amount, account.primary_currency_code)"></span>
<span x-show="parseFloat(account.pc_debt_amount) === 0.0" class="text-muted"
x-text="formatMoney(account.pc_debt_amount, account.primary_currency_code)"></span>
<span x-show="parseFloat(account.pc_debt_amount) > 0.0" class="text-success"
x-text="formatMoney(account.pc_debt_amount, account.primary_currency_code)"></span>
)
</span>
</template>
</template>
-->
FIXME
</td>
<td x-show="tableColumns.last_activity.visible && tableColumns.last_activity.enabled">
<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">
<template x-if="null !== account.balance_difference">
<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 x-show="null != account.balance_difference && account.balance_difference < 0" class="text-danger"
x-text="formatMoney(account.balance_difference, account.currency_code)"></span>
<span x-show="null != account.balance_difference && account.balance_difference == 0" class="text-muted"
x-text="formatMoney(account.balance_difference, account.currency_code)"></span>
<span x-show="null != account.balance_difference && account.balance_difference > 0" class="text-success"
x-text="formatMoney(account.balance_difference, account.currency_code)"></span>
</span>
</template>
<template x-if="null !== account.pc_balance_difference">
<span>(
<span x-show="parseFloat(account.pc_balance_difference) < 0.0" class="text-danger"
x-text="formatMoney(account.pc_balance_difference, account.primary_currency_code)"></span>
<span x-show="parseFloat(account.pc_balance_difference) === 0.0" class="text-muted"
x-text="formatMoney(account.pc_balance_difference, account.primary_currency_code)"></span>
<span x-show="parseFloat(account.pc_balance_difference) > 0.0" class="text-success"
x-text="formatMoney(account.pc_balance_difference, account.primary_currency_code)"></span>
)
</span>
</template>
</template>
</td>
<td x-show="tableColumns.menu.visible && tableColumns.menu.enabled">