Added Banking Link to show Document

This commit is contained in:
2025-10-05 16:15:51 +02:00
parent f74b717bc0
commit 625bb4be4a
2 changed files with 34 additions and 9 deletions

View File

@@ -19,7 +19,7 @@ const itemInfo = ref({})
const linkedDocument =ref({})
const setupPage = async () => {
if(route.params) {
if(route.params.id) itemInfo.value = await useEntities("createddocuments").selectSingle(route.params.id,"*,files(*),linkedDocument(*)")
if(route.params.id) itemInfo.value = await useEntities("createddocuments").selectSingle(route.params.id,"*,files(*),linkedDocument(*), statementallocations(bs_id)")
console.log(itemInfo.value)
@@ -36,6 +36,14 @@ const openEmail = () => {
router.push(`/email/new?loadDocuments=["${linkedDocument.value.id}"]`)
}
}
const openBankstatements = () => {
if(itemInfo.value.statementallocations.length > 1) {
navigateTo(`/banking/?filter=${JSON.stringify(itemInfo.value.statementallocations.map(i => i.bs_id))}`)
} else {
navigateTo(`/banking/statements/edit/${itemInfo.value.statementallocations[0].bs_id}`)
}
}
</script>
<template>
@@ -104,6 +112,14 @@ const openEmail = () => {
>
{{dataStore.documentTypesForCreation[itemInfo.linkedDocument.type].labelSingle}} - {{itemInfo.linkedDocument.documentNumber}}
</UButton>
<UButton
v-if="itemInfo.statementallocations?.length > 0"
@click="openBankstatements"
icon="i-heroicons-link"
variant="outline"
>
Bankbuchungen
</UButton>
</template>
</UDashboardToolbar>