Fixed transaction card money style for credited accounts.
Build and Deploy Web App / build-and-deploy (push) Successful in 24s
Details
Build and Deploy Web App / build-and-deploy (push) Successful in 24s
Details
This commit is contained in:
parent
5bda6812d6
commit
c9d20f2475
|
|
@ -5,7 +5,6 @@ import type { TransactionsListItem } from '@/api/transaction';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import CategoryLabel from './CategoryLabel.vue';
|
import CategoryLabel from './CategoryLabel.vue';
|
||||||
import { computed, type Ref } from 'vue';
|
import { computed, type Ref } from 'vue';
|
||||||
import { AccountTypes } from '@/api/account';
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
@ -16,15 +15,9 @@ const props = defineProps<{ tx: TransactionsListItem }>()
|
||||||
// Defines the style to use for money based on which accounts are involved.
|
// Defines the style to use for money based on which accounts are involved.
|
||||||
const moneyStyle: Ref<MoneyStyle> = computed(() => {
|
const moneyStyle: Ref<MoneyStyle> = computed(() => {
|
||||||
if (props.tx.debitedAccount !== null && props.tx.creditedAccount === null) {
|
if (props.tx.debitedAccount !== null && props.tx.creditedAccount === null) {
|
||||||
const debitedAccountType = AccountTypes.of(props.tx.debitedAccount.type)
|
return "positive"
|
||||||
return debitedAccountType.debitsPositive
|
|
||||||
? "positive"
|
|
||||||
: "negative"
|
|
||||||
} else if (props.tx.creditedAccount !== null && props.tx.debitedAccount === null) {
|
} else if (props.tx.creditedAccount !== null && props.tx.debitedAccount === null) {
|
||||||
const creditedAccountType = AccountTypes.of(props.tx.creditedAccount.type)
|
return "negative"
|
||||||
return creditedAccountType.debitsPositive
|
|
||||||
? "negative"
|
|
||||||
: "positive"
|
|
||||||
}
|
}
|
||||||
return "neutral"
|
return "neutral"
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue