Added Default Payment Method to Vendors
Added Auto Select to Create incoming
This commit is contained in:
@@ -38,13 +38,14 @@ const itemInfo = ref({
|
|||||||
const availableDocuments = ref([])
|
const availableDocuments = ref([])
|
||||||
const costcentres = ref([])
|
const costcentres = ref([])
|
||||||
const accounts = ref([])
|
const accounts = ref([])
|
||||||
|
const vendors = 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
|
accounts.value = (await supabase.from("accounts").select().order("number",{ascending:true})).data
|
||||||
|
vendors.value = await useSupabaseSelect("vendors")
|
||||||
}
|
}
|
||||||
|
|
||||||
setup()
|
setup()
|
||||||
@@ -230,6 +231,7 @@ const setCostCentre = async (item,data) => {
|
|||||||
class="flex-auto"
|
class="flex-auto"
|
||||||
searchable-placeholder="Suche..."
|
searchable-placeholder="Suche..."
|
||||||
:color="!itemInfo.vendor ? 'rose' : 'primary'"
|
: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}">
|
<template #option="{option}">
|
||||||
{{option.vendorNumber}} - {{option.name}}
|
{{option.vendorNumber}} - {{option.name}}
|
||||||
|
|||||||
@@ -1152,6 +1152,17 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
inputType: "bool",
|
inputType: "bool",
|
||||||
component: sepa
|
component: sepa
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: "defaultPaymentMethod",
|
||||||
|
label: "Standard Zahlungsmethode",
|
||||||
|
inputType: "select",
|
||||||
|
selectValueAttribute: "label",
|
||||||
|
selectManualOptions: [
|
||||||
|
{label:"Einzug"},
|
||||||
|
{label:"Überweisung"},
|
||||||
|
{label:"Kreditkarte"},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: "notes",
|
key: "notes",
|
||||||
label: "Notizen",
|
label: "Notizen",
|
||||||
|
|||||||
Reference in New Issue
Block a user