Fix: Do not display / send category in tracking accounts
& refetch transactions when creating transfers
This commit is contained in:
parent
26b9aa7be7
commit
f0c37a74c1
2 changed files with 14 additions and 3 deletions
|
@ -53,7 +53,9 @@
|
||||||
Date
|
Date
|
||||||
</th>
|
</th>
|
||||||
<th>Payee</th>
|
<th>Payee</th>
|
||||||
<th>Category</th>
|
<th v-if="account.type !== 'tracking'">
|
||||||
|
Category
|
||||||
|
</th>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
<th class="minimized-column text-end">
|
<th class="minimized-column text-end">
|
||||||
Amount
|
Amount
|
||||||
|
@ -80,7 +82,7 @@
|
||||||
type="text"
|
type="text"
|
||||||
>
|
>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td v-if="account.type !== 'tracking'">
|
||||||
<select
|
<select
|
||||||
v-model="form.category"
|
v-model="form.category"
|
||||||
class="form-select form-select-sm"
|
class="form-select form-select-sm"
|
||||||
|
@ -132,7 +134,9 @@
|
||||||
{{ new Date(tx.time).toLocaleDateString() }}
|
{{ new Date(tx.time).toLocaleDateString() }}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ tx.payee }}</td>
|
<td>{{ tx.payee }}</td>
|
||||||
<td>{{ accountIdToName[tx.category] }}</td>
|
<td v-if="account.type !== 'tracking'">
|
||||||
|
{{ accountIdToName[tx.category] }}
|
||||||
|
</td>
|
||||||
<td>{{ tx.description }}</td>
|
<td>{{ tx.description }}</td>
|
||||||
<td :class="{'minimized-column text-end': true, 'text-danger': tx.amount < 0}">
|
<td :class="{'minimized-column text-end': true, 'text-danger': tx.amount < 0}">
|
||||||
{{ formatNumber(tx.amount) }} €
|
{{ formatNumber(tx.amount) }} €
|
||||||
|
@ -285,6 +289,10 @@ export default {
|
||||||
components: { rangeSelector },
|
components: { rangeSelector },
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
account() {
|
||||||
|
return this.accounts.filter(acc => acc.id === this.accountId)[0] || {}
|
||||||
|
},
|
||||||
|
|
||||||
accountIdToName() {
|
accountIdToName() {
|
||||||
return Object.fromEntries(this.accounts.map(acc => [acc.id, acc.name]))
|
return Object.fromEntries(this.accounts.map(acc => [acc.id, acc.name]))
|
||||||
},
|
},
|
||||||
|
@ -379,6 +387,7 @@ export default {
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
...this.form,
|
...this.form,
|
||||||
account: this.accountId,
|
account: this.accountId,
|
||||||
|
category: this.form.category || null,
|
||||||
time: new Date(this.form.date),
|
time: new Date(this.form.date),
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -451,6 +460,7 @@ export default {
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$emit('update-accounts')
|
this.$emit('update-accounts')
|
||||||
|
this.fetchTransactions()
|
||||||
Modal.getInstance(this.$refs.transferMoneyModal).toggle()
|
Modal.getInstance(this.$refs.transferMoneyModal).toggle()
|
||||||
|
|
||||||
this.modals.createTransfer = {
|
this.modals.createTransfer = {
|
||||||
|
|
|
@ -283,6 +283,7 @@ export default {
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$emit('update-accounts')
|
this.$emit('update-accounts')
|
||||||
|
this.fetchTransactions()
|
||||||
Modal.getInstance(this.$refs.transferMoneyModal).toggle()
|
Modal.getInstance(this.$refs.transferMoneyModal).toggle()
|
||||||
|
|
||||||
this.modals.createTransfer = {
|
this.modals.createTransfer = {
|
||||||
|
|
Loading…
Reference in a new issue