Added Account Sorting

This commit is contained in:
2025-04-22 14:38:20 +02:00
parent e6c9942d7d
commit 1b2bc1424d
2 changed files with 5 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ const setup = async () => {
const documents = createddocuments.value.filter(i => i.type === "invoices" ||i.type === "advanceInvoices") const documents = createddocuments.value.filter(i => i.type === "invoices" ||i.type === "advanceInvoices")
const incominginvoices = (await useSupabaseSelect("incominginvoices","*, statementallocations(*), vendor(id,name)")).filter(i => i.state === "Gebucht") const incominginvoices = (await useSupabaseSelect("incominginvoices","*, statementallocations(*), vendor(id,name)")).filter(i => i.state === "Gebucht")
accounts.value = (await supabase.from("accounts").select()).data accounts.value = (await supabase.from("accounts").select().order("number",{ascending: true})).data
ownaccounts.value = (await supabase.from("ownaccounts").select()).data ownaccounts.value = (await supabase.from("ownaccounts").select()).data
customers.value = (await supabase.from("customers").select()).data customers.value = (await supabase.from("customers").select()).data
vendors.value = (await supabase.from("vendors").select()).data vendors.value = (await supabase.from("vendors").select()).data

View File

@@ -37,12 +37,13 @@ const itemInfo = ref({
const availableDocuments = ref([]) const availableDocuments = ref([])
const costcentres = ref([]) const costcentres = ref([])
const accounts = ref([])
const setup = async () => { const setup = async () => {
let filetype = (await supabase.from("filetags").select().eq("tenant",profileStore.currentTenant).eq("incomingDocumentType","invoices").single()).data.id let filetype = (await supabase.from("filetags").select().eq("tenant",profileStore.currentTenant).eq("incomingDocumentType","invoices").single()).data.id
console.log(filetype) console.log(filetype)
let ids = (await supabase.from("files").select("id").eq("tenant",profileStore.currentTenant).eq("type", filetype).is("incominginvoice",null)).data.map(i => i.id) let ids = (await supabase.from("files").select("id").eq("tenant",profileStore.currentTenant).eq("type", filetype).is("incominginvoice",null)).data.map(i => i.id)
availableDocuments.value = await useFiles().selectSomeDocuments(ids) availableDocuments.value = await useFiles().selectSomeDocuments(ids)
accounts.value = (await supabase.from("accounts").select().order("number",{ascending:true})).data
} }
@@ -351,7 +352,7 @@ const setCostCentre = async (item,data) => {
class="mb-3" class="mb-3"
> >
<USelectMenu <USelectMenu
:options="dataStore.accounts" :options="accounts"
option-attribute="label" option-attribute="label"
value-attribute="id" value-attribute="id"
searchable searchable
@@ -361,7 +362,7 @@ const setCostCentre = async (item,data) => {
:color="!item.account ? 'rose' : 'primary'" :color="!item.account ? 'rose' : 'primary'"
> >
<template #label> <template #label>
{{dataStore.accounts.find(account => account.id === item.account) ? dataStore.accounts.find(account => account.id === item.account).label : "Keine Kategorie ausgewählt" }} {{accounts.find(account => account.id === item.account) ? accounts.find(account => account.id === item.account).label : "Keine Kategorie ausgewählt" }}
</template> </template>
<template #option="{option}"> <template #option="{option}">
{{option.number}} - {{option.label}} {{option.number}} - {{option.label}}