Fix Createddocs

This commit is contained in:
2025-09-07 19:32:59 +02:00
parent 6d233f5bfb
commit c7e18d689e
4 changed files with 728 additions and 688 deletions

View File

@@ -31,11 +31,11 @@
</UDashboardNavbar>
<UDashboardToolbar>
<template #left>
<!-- <UCheckbox
v-model="showDrafts"
label="Entwürfe Anzeigen"
class="my-auto mr-3"
/>-->
<!-- <UCheckbox
v-model="showDrafts"
label="Entwürfe Anzeigen"
class="my-auto mr-3"
/>-->
<USelectMenu
v-model="selectedTypes"
icon="i-heroicons-adjustments-horizontal-solid"
@@ -204,7 +204,6 @@ const items = ref([])
const selectedItem = ref(0)
const setupPage = async () => {
//items.value = (await useSupabaseSelect("createddocuments","*, customer(id,name), statementallocations(id,amount),linkedDocument(*)","documentNumber")).filter(i => !i.archived)
items.value = (await useEntities("createddocuments").select("*, customer(id,name), statementallocations(id,amount),linkedDocument(*)","documentNumber")).filter(i => !i.archived)
}
@@ -220,7 +219,7 @@ const templateColumns = [
key: 'type',
label: "Typ",
sortable: true
},{
}, {
key: 'state',
label: "Status",
sortable: true
@@ -288,19 +287,19 @@ const types = computed(() => {
const selectItem = (item) => {
console.log(item)
if(item.state === "Entwurf"){
if (item.state === "Entwurf") {
router.push(`/createDocument/edit/${item.id}`)
} else if(item.state !== "Entwurf") {
} else if (item.state !== "Entwurf") {
router.push(`/createDocument/show/${item.id}`)
}
}
const displayCurrency = (value, currency = "€") => {
return `${Number(value).toFixed(2).replace(".",",")} ${currency}`
return `${Number(value).toFixed(2).replace(".", ",")} ${currency}`
}
const searchString = ref(tempStore.searchStrings['createddocuments'] ||'')
const searchString = ref(tempStore.searchStrings['createddocuments'] || '')
const clearSearchString = () => {
tempStore.clearSearchString('createddocuments')
@@ -309,7 +308,7 @@ const clearSearchString = () => {
const selectedFilters = ref([])
const filteredRows = computed(() => {
let temp = items.value.filter(i => types.value.find(x => x.key === 'invoices' ? ['invoices','advanceInvoices','cancellationInvoices'].includes(i.type) : x.key === i.type))
let temp = items.value.filter(i => types.value.find(x => x.key === 'invoices' ? ['invoices', 'advanceInvoices', 'cancellationInvoices'].includes(i.type) : x.key === i.type))
temp = temp.filter(i => i.type !== "serialInvoices")
/*if(showDrafts.value === true) {
@@ -318,7 +317,7 @@ const filteredRows = computed(() => {
temp = temp.filter(i => i.state !== "Entwurf")
}*/
if(selectedFilters.value.includes("Nur offene anzeigen")){
if (selectedFilters.value.includes("Nur offene anzeigen")) {
temp = temp.filter(i => !isPaid(i))
}