Added Default Payment Method to Vendors

Added Auto Select to Create incoming
This commit is contained in:
2025-04-22 14:46:12 +02:00
parent 1b2bc1424d
commit 50a22877e4
2 changed files with 14 additions and 1 deletions

View File

@@ -38,13 +38,14 @@ const itemInfo = ref({
const availableDocuments = ref([])
const costcentres = ref([])
const accounts = ref([])
const vendors = 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
vendors.value = await useSupabaseSelect("vendors")
}
setup()
@@ -230,6 +231,7 @@ const setCostCentre = async (item,data) => {
class="flex-auto"
searchable-placeholder="Suche..."
:color="!itemInfo.vendor ? 'rose' : 'primary'"
@change="vendors.find(i => i.id === itemInfo.vendor).defaultPaymentMethod ? itemInfo.paymentType = vendors.find(i => i.id === itemInfo.vendor).defaultPaymentMethod : null"
>
<template #option="{option}">
{{option.vendorNumber}} - {{option.name}}