diff --git a/src/locales/en.js b/src/locales/en.js index 6febb299..92877384 100644 --- a/src/locales/en.js +++ b/src/locales/en.js @@ -957,6 +957,9 @@ export default { 'Transfer In Amount': 'Transfer In Amount', 'Show Amount': 'Show Amount', 'Hide Amount': 'Hide Amount', + 'Swap Account': 'Swap Account', + 'Swap Amount': 'Swap Amount', + 'Swap Account and Amount': 'Swap Account and Amount', 'Category': 'Category', 'Account': 'Account', 'Source Account': 'Source Account', diff --git a/src/locales/zh_Hans.js b/src/locales/zh_Hans.js index 06f590c9..59680403 100644 --- a/src/locales/zh_Hans.js +++ b/src/locales/zh_Hans.js @@ -957,6 +957,9 @@ export default { 'Transfer In Amount': '转入金额', 'Show Amount': '显示金额', 'Hide Amount': '隐藏金额', + 'Swap Account': '交换账户', + 'Swap Amount': '交换金额', + 'Swap Account and Amount': '交换账户和金额', 'Category': '分类', 'Account': '账户', 'Source Account': '来源账户', diff --git a/src/views/desktop/transactions/list/dialogs/EditDialog.vue b/src/views/desktop/transactions/list/dialogs/EditDialog.vue index fd2553a3..6abe6fec 100644 --- a/src/views/desktop/transactions/list/dialogs/EditDialog.vue +++ b/src/views/desktop/transactions/list/dialogs/EditDialog.vue @@ -12,6 +12,19 @@ + + + + @@ -338,6 +351,7 @@ import { mdiDotsVertical, mdiEyeOffOutline, mdiEyeOutline, + mdiSwapHorizontal, mdiPound } from '@mdi/js'; @@ -371,6 +385,7 @@ export default { more: mdiDotsVertical, show: mdiEyeOutline, hide: mdiEyeOffOutline, + swap: mdiSwapHorizontal, tag: mdiPound } }; @@ -809,6 +824,19 @@ export default { this.geoLocationStatus = null; this.transaction.geoLocation = null; }, + swapTransactionData(swapAccount, swapAmount) { + if (swapAccount) { + const oldSourceAccountId = this.transaction.sourceAccountId; + this.transaction.sourceAccountId = this.transaction.destinationAccountId; + this.transaction.destinationAccountId = oldSourceAccountId; + } + + if (swapAmount) { + const oldSourceAmount = this.transaction.sourceAmount; + this.transaction.sourceAmount = this.transaction.destinationAmount; + this.transaction.destinationAmount = oldSourceAmount; + } + }, setTransaction(transaction, options, setContextData) { setTransactionModelByTransaction( this.transaction, diff --git a/src/views/mobile/transactions/EditPage.vue b/src/views/mobile/transactions/EditPage.vue index df5d4ca6..796db23b 100644 --- a/src/views/mobile/transactions/EditPage.vue +++ b/src/views/mobile/transactions/EditPage.vue @@ -319,6 +319,11 @@ + + {{ $t('Swap Account') }} + {{ $t('Swap Amount') }} + {{ $t('Swap Account and Amount') }} + {{ $t('Show Amount') }} {{ $t('Hide Amount') }} @@ -786,6 +791,19 @@ export default { this.geoLocationStatus = null; this.transaction.geoLocation = null; }, + swapTransactionData(swapAccount, swapAmount) { + if (swapAccount) { + const oldSourceAccountId = this.transaction.sourceAccountId; + this.transaction.sourceAccountId = this.transaction.destinationAccountId; + this.transaction.destinationAccountId = oldSourceAccountId; + } + + if (swapAmount) { + const oldSourceAmount = this.transaction.sourceAmount; + this.transaction.sourceAmount = this.transaction.destinationAmount; + this.transaction.destinationAmount = oldSourceAmount; + } + }, getFontClassByAmount(amount) { if (amount >= 100000000 || amount <= -100000000) { return 'ebk-small-amount';