mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
code refactor
This commit is contained in:
@@ -627,7 +627,7 @@ export const useTransactionsStore = defineStore('transactions', {
|
||||
geoLocation: null
|
||||
};
|
||||
},
|
||||
setTransactionSuitableDestinationAmount(transaction, oldValue, newValue, destinationAccountCurrency) {
|
||||
setTransactionSuitableDestinationAmount(transaction, oldValue, newValue) {
|
||||
const accountsStore = useAccountsStore();
|
||||
const exchangeRatesStore = useExchangeRatesStore();
|
||||
|
||||
@@ -638,7 +638,7 @@ export const useTransactionsStore = defineStore('transactions', {
|
||||
const destinationAccount = accountsStore.allAccountsMap[transaction.destinationAccountId];
|
||||
|
||||
if (sourceAccount && destinationAccount && sourceAccount.currency !== destinationAccount.currency) {
|
||||
const decimalNumberCount = getCurrencyFraction(destinationAccountCurrency);
|
||||
const decimalNumberCount = getCurrencyFraction(destinationAccount.currency);
|
||||
const exchangedOldValue = exchangeRatesStore.getExchangedAmount(oldValue, sourceAccount.currency, destinationAccount.currency);
|
||||
const exchangedNewValue = exchangeRatesStore.getExchangedAmount(newValue, sourceAccount.currency, destinationAccount.currency);
|
||||
|
||||
|
||||
@@ -757,7 +757,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
this.transactionsStore.setTransactionSuitableDestinationAmount(this.transaction, oldValue, newValue, this.destinationAccountCurrency);
|
||||
this.transactionsStore.setTransactionSuitableDestinationAmount(this.transaction, oldValue, newValue);
|
||||
},
|
||||
'transaction.destinationAmount': function (newValue) {
|
||||
if (this.mode === 'view' || this.loading) {
|
||||
|
||||
@@ -882,7 +882,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
this.transactionsStore.setTransactionSuitableDestinationAmount(this.transaction, oldValue, newValue, this.destinationAccountCurrency);
|
||||
this.transactionsStore.setTransactionSuitableDestinationAmount(this.transaction, oldValue, newValue);
|
||||
},
|
||||
'transaction.destinationAmount': function (newValue) {
|
||||
if (this.mode === 'view' || this.loading) {
|
||||
|
||||
Reference in New Issue
Block a user