mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 16:24:25 +08:00
code refactor
This commit is contained in:
@@ -369,8 +369,8 @@ export default {
|
||||
}
|
||||
|
||||
if (sourceAccount && destinationAccount && sourceAccount.currency !== destinationAccount.currency) {
|
||||
const exchangedOldValue = this.$exchangeRates.getOtherCurrencyAmount(oldValue, sourceAccount.currency, destinationAccount.currency);
|
||||
const exchangedNewValue = this.$exchangeRates.getOtherCurrencyAmount(newValue, sourceAccount.currency, destinationAccount.currency);
|
||||
const exchangedOldValue = this.$store.getters.getExchangedAmount(oldValue, sourceAccount.currency, destinationAccount.currency);
|
||||
const exchangedNewValue = this.$store.getters.getExchangedAmount(newValue, sourceAccount.currency, destinationAccount.currency);
|
||||
|
||||
if (this.$utilities.isNumber(exchangedOldValue)) {
|
||||
oldValue = Math.floor(exchangedOldValue);
|
||||
@@ -704,7 +704,7 @@ export default {
|
||||
totalBalance += accountsBalance[i].balance;
|
||||
}
|
||||
} else {
|
||||
const balance = this.$exchangeRates.getOtherCurrencyAmount(accountsBalance[i].balance, accountsBalance[i].currency, this.defaultCurrency);
|
||||
const balance = this.$store.getters.getExchangedAmount(accountsBalance[i].balance, accountsBalance[i].currency, this.defaultCurrency);
|
||||
|
||||
if (!this.$utilities.isNumber(balance)) {
|
||||
hasUnCalculatedAmount = true;
|
||||
|
||||
@@ -888,7 +888,7 @@ export default {
|
||||
let amount = transaction.sourceAmount;
|
||||
|
||||
if (transaction.sourceAccount.currency !== this.defaultCurrency) {
|
||||
const balance = this.$exchangeRates.getOtherCurrencyAmount(amount, transaction.sourceAccount.currency, this.defaultCurrency);
|
||||
const balance = this.$store.getters.getExchangedAmount(amount, transaction.sourceAccount.currency, this.defaultCurrency);
|
||||
|
||||
if (!this.$utilities.isNumber(balance)) {
|
||||
if (transaction.type === this.$constants.transaction.allTransactionTypes.Expense) {
|
||||
|
||||
Reference in New Issue
Block a user