Rename Transaction to TX to match input row

This commit is contained in:
Jan Bader 2022-02-25 22:14:13 +00:00
parent 10ea73663f
commit 5f161b2163

View File

@ -9,17 +9,17 @@ const props = defineProps<{
}>() }>()
const accountStore = useAccountStore(); const accountStore = useAccountStore();
const Transaction = accountStore.Transactions.get(props.transactionid)!; const TX = accountStore.Transactions.get(props.transactionid)!;
const payload = computed(() => JSON.stringify({ const payload = computed(() => JSON.stringify({
date: Transaction.Date.toISOString().split("T")[0], date: TX.Date.toISOString().split("T")[0],
payee: { payee: {
Name: Transaction.Payee, Name: TX.Payee,
ID: Transaction.PayeeID, ID: TX.PayeeID,
}, },
categoryId: Transaction.CategoryID, categoryId: TX.CategoryID,
memo: Transaction.Memo, memo: TX.Memo,
amount: Transaction.Amount.toString(), amount: TX.Amount.toString(),
state: "Uncleared" state: "Uncleared"
})); }));
@ -32,22 +32,22 @@ function saveTransaction(e: MouseEvent) {
<template> <template>
<tr> <tr>
<td style="width: 90px;" class="text-sm"> <td style="width: 90px;" class="text-sm">
<DateInput class="border-b-2 border-black" v-model="Transaction.Date" /> <DateInput class="border-b-2 border-black" v-model="TX.Date" />
</td> </td>
<td style="max-width: 150px;"> <td style="max-width: 150px;">
<Autocomplete v-model:text="Transaction.Payee" v-model:id="Transaction.PayeeID" type="payees" /> <Autocomplete v-model:text="TX.Payee" v-model:id="TX.PayeeID" type="payees" />
</td> </td>
<td style="max-width: 200px;"> <td style="max-width: 200px;">
<Autocomplete v-model:text="Transaction.Category" v-model:id="Transaction.CategoryID" type="categories" /> <Autocomplete v-model:text="TX.Category" v-model:id="TX.CategoryID" type="categories" />
</td> </td>
<td> <td>
<input class="block w-full border-b-2 border-black" type="text" v-model="Transaction.Memo" /> <input class="block w-full border-b-2 border-black" type="text" v-model="TX.Memo" />
</td> </td>
<td style="width: 80px;" class="text-right"> <td style="width: 80px;" class="text-right">
<input <input
class="text-right block w-full border-b-2 border-black" class="text-right block w-full border-b-2 border-black"
type="currency" type="currency"
v-model="Transaction.Amount" v-model="TX.Amount"
/> />
</td> </td>
<td style="width: 20px;"> <td style="width: 20px;">