Added Banking Link to show Document
This commit is contained in:
@@ -12,6 +12,7 @@ defineShortcuts({
|
||||
|
||||
const tempStore = useTempStore()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const bankstatements = ref([])
|
||||
const bankaccounts = ref([])
|
||||
@@ -80,6 +81,10 @@ const selectedFilters = ref(tempStore.filters["banking"] ? tempStore.filters["ba
|
||||
const filteredRows = computed(() => {
|
||||
let temp = bankstatements.value
|
||||
|
||||
if(route.query.filter) {
|
||||
console.log(route.query.filter)
|
||||
temp = temp.filter(i => JSON.parse(route.query.filter).includes(i.id))
|
||||
} else {
|
||||
if(selectedFilters.value.includes("Nur offene anzeigen")){
|
||||
temp = temp.filter(i => Number(calculateOpenSum(i)) !== 0)
|
||||
}
|
||||
@@ -91,6 +96,10 @@ const filteredRows = computed(() => {
|
||||
if(selectedFilters.value.includes("Nur negative anzeigen")){
|
||||
temp = temp.filter(i => i.amount < 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return useSearch(searchString.value, temp.filter(i => filterAccount.value.find(x => x.id === i.account)))
|
||||
})
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user