Added buttons to add transaction via account page.
Build and Deploy Web App / build-and-deploy (push) Successful in 19s
Details
Build and Deploy Web App / build-and-deploy (push) Successful in 19s
Details
This commit is contained in:
parent
43b1f153ad
commit
6fd388b656
|
|
@ -58,6 +58,17 @@ async function addValueRecord() {
|
|||
history.value?.reload()
|
||||
}
|
||||
}
|
||||
|
||||
async function addCreditTransaction() {
|
||||
await router.push(
|
||||
`/profiles/${getSelectedProfile(route)}/add-transaction?credited-account=${account.value?.id}`,
|
||||
)
|
||||
}
|
||||
async function addDebitTransaction() {
|
||||
await router.push(
|
||||
`/profiles/${getSelectedProfile(route)}/add-transaction?debited-account=${account.value?.id}`,
|
||||
)
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<AppPage
|
||||
|
|
@ -115,6 +126,22 @@ async function addValueRecord() {
|
|||
>Delete</AppButton
|
||||
>
|
||||
</ButtonBar>
|
||||
<ButtonBar>
|
||||
<AppButton
|
||||
@click="addCreditTransaction()"
|
||||
:disabled="account.archived"
|
||||
size="sm"
|
||||
icon="arrow-up-right-from-square"
|
||||
>Add Credit Transaction
|
||||
</AppButton>
|
||||
<AppButton
|
||||
@click="addDebitTransaction()"
|
||||
:disabled="account.archived"
|
||||
size="sm"
|
||||
icon="arrow-up-right-from-square"
|
||||
>Add Debit Transaction</AppButton
|
||||
>
|
||||
</ButtonBar>
|
||||
|
||||
<AccountHistory
|
||||
:account="account"
|
||||
|
|
|
|||
|
|
@ -185,6 +185,14 @@ onMounted(async () => {
|
|||
timestamp.value = getDatetimeLocalValueForNow()
|
||||
amount.value = Math.pow(10, currency.value?.fractionalDigits ?? 0)
|
||||
}
|
||||
|
||||
// Load default values from the query parameters.
|
||||
if ('credited-account' in route.query) {
|
||||
creditedAccountId.value = parseInt(route.query['credited-account'] as string)
|
||||
}
|
||||
if ('debited-account' in route.query) {
|
||||
debitedAccountId.value = parseInt(route.query['debited-account'] as string)
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue