mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-21 02:04:26 +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++) {
|
for (let i = 0; i < transactionMonthList.items.length; i++) {
|
||||||
const transaction = transactionMonthList.items[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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let amount = transaction.sourceAmount;
|
if (account.currency !== defaultCurrency) {
|
||||||
|
const balance = getExchangedAmount(state)(amount, account.currency, defaultCurrency);
|
||||||
if (transaction.sourceAccount.currency !== defaultCurrency) {
|
|
||||||
const balance = getExchangedAmount(state)(amount, transaction.sourceAccount.currency, defaultCurrency);
|
|
||||||
|
|
||||||
if (!utils.isNumber(balance)) {
|
if (!utils.isNumber(balance)) {
|
||||||
if (transaction.type === transactionConstants.allTransactionTypes.Expense) {
|
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">→</span>
|
||||||
<span v-if="transaction.sourceAccount && transaction.type === $constants.transaction.allTransactionTypes.Transfer && transaction.destinationAccount && transaction.sourceAccount.id !== transaction.destinationAccount.id">{{ transaction.destinationAccount.name }}</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>
|
||||||
<div slot="after" class="transaction-amount" v-if="transaction.sourceAccount">
|
<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 }">
|
: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 v-if="!query.accountId || query.accountId === '0' || (transaction.sourceAccount && transaction.sourceAccount.id === query.accountId)">{{ transaction.sourceAmount | currency(transaction.sourceAccount.currency) }}</span>
|
||||||
</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>
|
</div>
|
||||||
<f7-swipeout-actions right>
|
<f7-swipeout-actions right>
|
||||||
<f7-swipeout-button color="primary" close
|
<f7-swipeout-button color="primary" close
|
||||||
|
|||||||
Reference in New Issue
Block a user