mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-21 02:04:26 +08:00
fix liability account balance display
This commit is contained in:
@@ -343,7 +343,7 @@ export default {
|
|||||||
|
|
||||||
for (let i = 0; i < accountsBalance.length; i++) {
|
for (let i = 0; i < accountsBalance.length; i++) {
|
||||||
if (accountsBalance[i].currency === this.defaultCurrency) {
|
if (accountsBalance[i].currency === this.defaultCurrency) {
|
||||||
totalLiabilities += accountsBalance[i].balance;
|
totalLiabilities -= accountsBalance[i].balance;
|
||||||
} else {
|
} else {
|
||||||
const balance = this.$exchangeRates.getOtherCurrencyAmount(accountsBalance[i].balance, accountsBalance[i].currency, this.defaultCurrency);
|
const balance = this.$exchangeRates.getOtherCurrencyAmount(accountsBalance[i].balance, accountsBalance[i].currency, this.defaultCurrency);
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ export default {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
totalLiabilities += Math.floor(balance);
|
totalLiabilities -= Math.floor(balance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,7 +465,13 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.showAccountBalance) {
|
if (this.showAccountBalance) {
|
||||||
return account.balance;
|
if (account.isAsset) {
|
||||||
|
return account.balance;
|
||||||
|
} else if (account.isLiability) {
|
||||||
|
return -account.balance;
|
||||||
|
} else {
|
||||||
|
return account.balance;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return '***';
|
return '***';
|
||||||
}
|
}
|
||||||
@@ -481,7 +487,13 @@ export default {
|
|||||||
|
|
||||||
for (let i = 0; i < accountsBalance.length; i++) {
|
for (let i = 0; i < accountsBalance.length; i++) {
|
||||||
if (accountsBalance[i].currency === this.defaultCurrency) {
|
if (accountsBalance[i].currency === this.defaultCurrency) {
|
||||||
totalBalance += accountsBalance[i].balance;
|
if (accountsBalance[i].isAsset) {
|
||||||
|
totalBalance += accountsBalance[i].balance;
|
||||||
|
} else if (accountsBalance[i].isLiability) {
|
||||||
|
totalBalance -= accountsBalance[i].balance;
|
||||||
|
} else {
|
||||||
|
totalBalance += accountsBalance[i].balance;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const balance = this.$exchangeRates.getOtherCurrencyAmount(accountsBalance[i].balance, accountsBalance[i].currency, this.defaultCurrency);
|
const balance = this.$exchangeRates.getOtherCurrencyAmount(accountsBalance[i].balance, accountsBalance[i].currency, this.defaultCurrency);
|
||||||
|
|
||||||
@@ -490,7 +502,13 @@ export default {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
totalBalance += Math.floor(balance);
|
if (accountsBalance[i].isAsset) {
|
||||||
|
totalBalance += Math.floor(balance);
|
||||||
|
} else if (accountsBalance[i].isLiability) {
|
||||||
|
totalBalance -= Math.floor(balance);
|
||||||
|
} else {
|
||||||
|
totalBalance += Math.floor(balance);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -607,7 +607,13 @@ export default {
|
|||||||
const account = accounts[i];
|
const account = accounts[i];
|
||||||
|
|
||||||
if (this.showAccountBalance) {
|
if (this.showAccountBalance) {
|
||||||
account.displayBalance = this.$options.filters.currency(account.balance, account.currency);
|
if (account.isAsset) {
|
||||||
|
account.displayBalance = this.$options.filters.currency(account.balance, account.currency);
|
||||||
|
} else if (account.isLiability) {
|
||||||
|
account.displayBalance = this.$options.filters.currency(-account.balance, account.currency);
|
||||||
|
} else {
|
||||||
|
account.displayBalance = this.$options.filters.currency(account.balance, account.currency);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
account.displayBalance = '***';
|
account.displayBalance = '***';
|
||||||
}
|
}
|
||||||
@@ -628,7 +634,13 @@ export default {
|
|||||||
|
|
||||||
for (let i = 0; i < accountsBalance.length; i++) {
|
for (let i = 0; i < accountsBalance.length; i++) {
|
||||||
if (accountsBalance[i].currency === this.defaultCurrency) {
|
if (accountsBalance[i].currency === this.defaultCurrency) {
|
||||||
totalBalance += accountsBalance[i].balance;
|
if (accountsBalance[i].isAsset) {
|
||||||
|
totalBalance += accountsBalance[i].balance;
|
||||||
|
} else if (accountsBalance[i].isLiability) {
|
||||||
|
totalBalance -= accountsBalance[i].balance;
|
||||||
|
} else {
|
||||||
|
totalBalance += accountsBalance[i].balance;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const balance = this.$exchangeRates.getOtherCurrencyAmount(accountsBalance[i].balance, accountsBalance[i].currency, this.defaultCurrency);
|
const balance = this.$exchangeRates.getOtherCurrencyAmount(accountsBalance[i].balance, accountsBalance[i].currency, this.defaultCurrency);
|
||||||
|
|
||||||
@@ -637,7 +649,13 @@ export default {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
totalBalance += Math.floor(balance);
|
if (accountsBalance[i].isAsset) {
|
||||||
|
totalBalance += Math.floor(balance);
|
||||||
|
} else if (accountsBalance[i].isLiability) {
|
||||||
|
totalBalance -= Math.floor(balance);
|
||||||
|
} else {
|
||||||
|
totalBalance += Math.floor(balance);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user