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

@@ -37,12 +37,13 @@ const itemInfo = ref({
const availableDocuments = ref([])
const costcentres = ref([])
const accounts = ref([])
const setup = async () => {
let filetype = (await supabase.from("filetags").select().eq("tenant",profileStore.currentTenant).eq("incomingDocumentType","invoices").single()).data.id
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)
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"
>
<USelectMenu
:options="dataStore.accounts"
:options="accounts"
option-attribute="label"
value-attribute="id"
searchable
@@ -361,7 +362,7 @@ const setCostCentre = async (item,data) => {
:color="!item.account ? 'rose' : 'primary'"
>
<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 #option="{option}">
{{option.number}} - {{option.label}}