Added Account Sorting
This commit is contained in:
@@ -49,7 +49,7 @@ const setup = async () => {
|
||||
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")
|
||||
|
||||
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
|
||||
customers.value = (await supabase.from("customers").select()).data
|
||||
vendors.value = (await supabase.from("vendors").select()).data
|
||||
|
||||
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user