diff --git a/src/components/TransactionEditor.vue b/src/components/TransactionEditor.vue new file mode 100644 index 0000000..d22bf6c --- /dev/null +++ b/src/components/TransactionEditor.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/src/db.ts b/src/db.ts index b4aebc7..802deee 100644 --- a/src/db.ts +++ b/src/db.ts @@ -202,9 +202,9 @@ export function deserialiseAmount(amount: string): { quantity: number, commodity export class Transaction { constructor( - public id: number = null!, - public dt: string = null!, - public description: string = null!, + public id: number | null = null, + public dt: string = '', + public description: string = '', public postings: Posting[] = [], ) {} @@ -219,7 +219,7 @@ export class Transaction { } export interface Posting { - id: number, + id: number | null, description: string | null, account: string, quantity: number, diff --git a/src/main.ts b/src/main.ts index fb91b92..9230c11 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,6 +33,7 @@ async function initApp() { { path: '/general-ledger', name: 'general-ledger', component: () => import('./pages/GeneralLedgerView.vue') }, { path: '/journal', name: 'journal', component: () => import('./pages/JournalView.vue') }, { path: '/journal/edit-transaction/:id', name: 'journal-edit-transaction', component: () => import('./pages/EditTransactionView.vue') }, + { path: '/journal/new-transaction', name: 'journal-new-transaction', component: () => import('./pages/NewTransactionView.vue') }, { path: '/transactions/:account', name: 'transactions', component: () => import('./pages/TransactionsView.vue') }, { path: '/trial-balance', name: 'trial-balance', component: () => import('./pages/TrialBalanceView.vue') }, ]; diff --git a/src/pages/EditTransactionView.vue b/src/pages/EditTransactionView.vue index 898efdd..b70aa0e 100644 --- a/src/pages/EditTransactionView.vue +++ b/src/pages/EditTransactionView.vue @@ -21,128 +21,27 @@ Edit transaction - - - - - - - - - - - - - - - - - - - - - - - - -
DateDescriptionDrCr
- - - -
-
-
-
- -
-
- - -
-
- -
-
- -
- - -
- -
-
-
- -
-
-

{{ error }}

-
-
-
+ diff --git a/src/pages/JournalView.vue b/src/pages/JournalView.vue index f8534d9..e158af6 100644 --- a/src/pages/JournalView.vue +++ b/src/pages/JournalView.vue @@ -22,12 +22,11 @@
- + + New transaction - --> +
@@ -62,7 +61,7 @@ import dayjs from 'dayjs'; - import { PencilIcon } from '@heroicons/vue/24/outline'; + import { PencilIcon, PlusIcon } from '@heroicons/vue/24/outline'; import { onUnmounted, ref, watch } from 'vue'; diff --git a/src/pages/NewTransactionView.vue b/src/pages/NewTransactionView.vue new file mode 100644 index 0000000..a374cc8 --- /dev/null +++ b/src/pages/NewTransactionView.vue @@ -0,0 +1,57 @@ + + + + +