mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 15:07:33 +08:00
show destination amount for transfer-in transaction
This commit is contained in:
@@ -298,14 +298,20 @@ export function calculateMonthTotalAmount(state, transactionMonthList, defaultCu
|
||||
for (let i = 0; i < transactionMonthList.items.length; i++) {
|
||||
const transaction = transactionMonthList.items[i];
|
||||
|
||||
if (!transaction.sourceAccount) {
|
||||
let amount = transaction.sourceAmount;
|
||||
let account = transaction.sourceAccount;
|
||||
|
||||
if (accountId && transaction.destinationAccount && transaction.destinationAccount.id === accountId) {
|
||||
amount = transaction.destinationAmount;
|
||||
account = transaction.destinationAccount;
|
||||
}
|
||||
|
||||
if (!account) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let amount = transaction.sourceAmount;
|
||||
|
||||
if (transaction.sourceAccount.currency !== defaultCurrency) {
|
||||
const balance = getExchangedAmount(state)(amount, transaction.sourceAccount.currency, defaultCurrency);
|
||||
if (account.currency !== defaultCurrency) {
|
||||
const balance = getExchangedAmount(state)(amount, account.currency, defaultCurrency);
|
||||
|
||||
if (!utils.isNumber(balance)) {
|
||||
if (transaction.type === transactionConstants.allTransactionTypes.Expense) {
|
||||
|
||||
@@ -199,10 +199,10 @@
|
||||
<span v-if="transaction.sourceAccount && transaction.type === $constants.transaction.allTransactionTypes.Transfer && transaction.destinationAccount && transaction.sourceAccount.id !== transaction.destinationAccount.id">→</span>
|
||||
<span v-if="transaction.sourceAccount && transaction.type === $constants.transaction.allTransactionTypes.Transfer && transaction.destinationAccount && transaction.sourceAccount.id !== transaction.destinationAccount.id">{{ transaction.destinationAccount.name }}</span>
|
||||
</div>
|
||||
<div slot="after" class="transaction-amount" v-if="transaction.sourceAccount">
|
||||
<span :class="{ 'text-color-teal': transaction.type === $constants.transaction.allTransactionTypes.Expense, 'text-color-red': transaction.type === $constants.transaction.allTransactionTypes.Income }">
|
||||
{{ transaction.sourceAmount | currency(transaction.sourceAccount.currency) }}
|
||||
</span>
|
||||
<div slot="after" class="transaction-amount" v-if="transaction.sourceAccount"
|
||||
:class="{ 'text-color-teal': transaction.type === $constants.transaction.allTransactionTypes.Expense, 'text-color-red': transaction.type === $constants.transaction.allTransactionTypes.Income }">
|
||||
<span v-if="!query.accountId || query.accountId === '0' || (transaction.sourceAccount && transaction.sourceAccount.id === query.accountId)">{{ transaction.sourceAmount | currency(transaction.sourceAccount.currency) }}</span>
|
||||
<span v-else-if="query.accountId && query.accountId !== '0' && transaction.destinationAccount && transaction.destinationAccount.id === query.accountId">{{ transaction.destinationAmount | currency(transaction.destinationAccount.currency) }}</span>
|
||||
</div>
|
||||
<f7-swipeout-actions right>
|
||||
<f7-swipeout-button color="primary" close
|
||||
|
||||
Reference in New Issue
Block a user