account edit page displays the debt amount instead of the balance for credit card and debt accounts

This commit is contained in:
MaysWind
2025-02-11 00:45:23 +08:00
parent 18a6d25ed6
commit ab58109e5e
12 changed files with 133 additions and 28 deletions
@@ -146,8 +146,9 @@
:persistent-placeholder="true"
:currency="selectedAccount.currency"
:show-currency="true"
:label="currentAccountIndex < 0 ? tt('Account Balance') : tt('Sub-account Balance')"
:placeholder="currentAccountIndex < 0 ? tt('Account Balance') : tt('Sub-account Balance')"
:flip-negative="account.isLiability"
:label="accountAmountTitle"
:placeholder="accountAmountTitle"
v-model="selectedAccount.balance"/>
</v-col>
<v-col cols="12" md="6" v-show="selectedAccount.balance"
@@ -274,6 +275,14 @@ const selectedAccount = computed<Account>(() => {
return subAccounts.value[currentAccountIndex.value];
});
const accountAmountTitle = computed<string>(() => {
if (currentAccountIndex.value < 0) {
return account.value.isLiability ? tt('Account Outstanding Balance') : tt('Account Balance');
} else {
return account.value.isLiability ? tt('Sub-account Outstanding Balance') : tt('Sub-account Balance');
}
});
let resolveFunc: ((value: AccountEditResponse) => void) | null = null;
let rejectFunc: ((reason?: unknown) => void) | null = null;