This commit is contained in:
Jan Bader 2022-04-23 11:26:58 +00:00 committed by Gitea
parent c30b33a070
commit 91ac05b575
6 changed files with 29 additions and 69 deletions

View File

@ -8,8 +8,8 @@ import Input from "./Input.vue";
import Button from "./SimpleButton.vue"; import Button from "./SimpleButton.vue";
const props = defineProps<{ const props = defineProps<{
transactionid: string transactionid: string,
withAccount: bool withAccount: boolean,
}>() }>()
const emit = defineEmits(["save"]); const emit = defineEmits(["save"]);
@ -41,52 +41,25 @@ function saveTransaction(e: MouseEvent) {
<template> <template>
<tr> <tr>
<td class="text-sm"> <td class="text-sm">
<DateInput <DateInput v-model="TX.Date" class="border-b-2 border-black" />
v-model="TX.Date"
class="border-b-2 border-black"
/>
</td> </td>
<td v-if="withAccount"> <td v-if="withAccount">
<Autocomplete <Autocomplete v-model:text="TX.Account" v-model:id="TX.AccountID" model="accounts" />
v-model:text="TX.Account"
v-model:id="TX.AccountID"
model="accounts"
/>
</td> </td>
<td> <td>
<Autocomplete <Autocomplete v-model:text="TX.Payee" v-model:id="TX.PayeeID" v-model:type="payeeType" model="payees" />
v-model:text="TX.Payee"
v-model:id="TX.PayeeID"
v-model:type="payeeType"
model="payees"
/>
</td> </td>
<td> <td>
<Autocomplete <Autocomplete v-model:text="TX.Category" v-model:id="TX.CategoryID" model="categories" />
v-model:text="TX.Category"
v-model:id="TX.CategoryID"
model="categories"
/>
</td> </td>
<td> <td>
<Input <Input v-model="TX.Memo" class="block w-full border-b-2 border-black" type="text" />
v-model="TX.Memo"
class="block w-full border-b-2 border-black"
type="text"
/>
</td> </td>
<td class="text-right"> <td class="text-right">
<Input <Input v-model="TX.Amount" class="text-right block w-full border-b-2 border-black" type="currency" />
v-model="TX.Amount"
class="text-right block w-full border-b-2 border-black"
type="currency"
/>
</td> </td>
<td> <td>
<Button <Button class="bg-blue-500" @click="saveTransaction">
class="bg-blue-500"
@click="saveTransaction"
>
Save Save
</Button> </Button>
</td> </td>

View File

@ -24,7 +24,9 @@ const TX = ref<Transaction>({
ID: "", ID: "",
Status: "Uncleared", Status: "Uncleared",
TransferAccount: "", TransferAccount: "",
Reconciled: false Reconciled: false,
Account: "",
AccountID: "",
}); });
const payeeType = ref<string|undefined>(undefined); const payeeType = ref<string|undefined>(undefined);

View File

@ -11,7 +11,7 @@ import Checkbox from "./Checkbox.vue";
const props = defineProps<{ const props = defineProps<{
transactionid: string, transactionid: string,
index: number, index: number,
withAccount: bool, withAccount: boolean,
}>(); }>();
const edit = ref(false); const edit = ref(false);

View File

@ -142,8 +142,9 @@ function createReconcilationTransaction() {
<TransactionRow <TransactionRow
v-for="transaction in dayTransactions" v-for="transaction in dayTransactions"
:key="transaction.ID" :key="transaction.ID"
:transactionid="transaction.ID"
:index="index" :index="index"
:transactionid="transaction.ID"
:with-account="false"
/> />
</template> </template>
</table> </table>

View File

@ -56,23 +56,6 @@ onMounted(() => {
:index="index" :index="index"
/> />
</table> </table>
<div class="md:hidden">
<Modal @submit="submitModal">
<template #placeholder>
<Button
class="fixed right-4 bottom-4 font-bold text-lg bg-blue-500 py-2"
>
+
</Button>
</template>
<TransactionInputRow
ref="modalInputRow"
class="flex flex-col w-full h-full top-0"
:budgetid="budgetid"
:accountid="accountid"
/>
</Modal>
</div>
</template> </template>
<style> <style>

View File

@ -24,6 +24,7 @@ export interface Transaction {
PayeeID: string | undefined; PayeeID: string | undefined;
Amount: number; Amount: number;
Reconciled: boolean; Reconciled: boolean;
Account: string;
AccountID: string; AccountID: string;
} }