Redone Banksettings
This commit is contained in:
@@ -305,8 +305,7 @@ const links = computed(() => {
|
|||||||
},{
|
},{
|
||||||
label: "Bankkonten",
|
label: "Bankkonten",
|
||||||
to: "/settings/banking",
|
to: "/settings/banking",
|
||||||
icon: "i-heroicons-currency-euro",
|
icon: "i-heroicons-currency-euro"
|
||||||
disabled: true
|
|
||||||
},{
|
},{
|
||||||
label: "Textvorlagen",
|
label: "Textvorlagen",
|
||||||
to: "/settings/texttemplates",
|
to: "/settings/texttemplates",
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const setup = async () => {
|
|||||||
allocatedIncomingInvoices.value = incominginvoices.filter(i => i.statementallocations.find(x => x.bs_id === itemInfo.value.id))
|
allocatedIncomingInvoices.value = incominginvoices.filter(i => i.statementallocations.find(x => x.bs_id === itemInfo.value.id))
|
||||||
console.log(allocatedDocuments.value)
|
console.log(allocatedDocuments.value)
|
||||||
console.log(allocatedIncomingInvoices.value)
|
console.log(allocatedIncomingInvoices.value)
|
||||||
openIncomingInvoices.value = (await useEntities("incominginvoices").select("*, statementallocations(*), vendor(*)")).filter(i => i.statementallocations.reduce((n,{amount}) => n + amount, 0).toFixed(2) !== getInvoiceSum(i,false))
|
openIncomingInvoices.value = (await useEntities("incominginvoices").select("*, statementallocations(*), vendor(*)")).filter(i => !i.archived && i.statementallocations.reduce((n,{amount}) => n + amount, 0).toFixed(2) !== getInvoiceSum(i,false))
|
||||||
//console.log(openIncomingInvoices.value)
|
//console.log(openIncomingInvoices.value)
|
||||||
|
|
||||||
// return incominginvoices.value.filter(i => bankstatements.value.filter(x => x.assignments.find(y => y.type === 'incomingInvoice' && y.id === i.id)).length === 0)
|
// return incominginvoices.value.filter(i => bankstatements.value.filter(x => x.assignments.find(y => y.type === 'incomingInvoice' && y.id === i.id)).length === 0)
|
||||||
@@ -181,14 +181,14 @@ const searchString = ref("")
|
|||||||
const filteredDocuments = computed(() => {
|
const filteredDocuments = computed(() => {
|
||||||
|
|
||||||
|
|
||||||
return useSearch(searchString.value, openDocuments.value)
|
return useSearch(searchString.value, openDocuments.value.filter(i => i.state === "Gebucht"))
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const filteredIncomingInvoices = computed(() => {
|
const filteredIncomingInvoices = computed(() => {
|
||||||
|
|
||||||
|
|
||||||
return useSearch(searchString.value, openIncomingInvoices.value)
|
return useSearch(searchString.value, openIncomingInvoices.value.filter(i => i.state === "Gebucht"))
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const setupPage = async () => {
|
|||||||
reqData.value = await useFunctions().useBankingListRequisitions(route.query.ref)
|
reqData.value = await useFunctions().useBankingListRequisitions(route.query.ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
bankaccounts.value = await useSupabaseSelect("bankaccounts")
|
bankaccounts.value = await useEntities("bankaccounts").select()
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkBIC = async () => {
|
const checkBIC = async () => {
|
||||||
@@ -61,11 +61,15 @@ const addAccount = async (account) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const updateAccount = async (account) => {
|
const updateAccount = async (account) => {
|
||||||
const {data,error} = await supabase.from("bankaccounts").update({accountId: account.id, expired: false}).eq("iban",account.iban).select()
|
|
||||||
if(error) {
|
let bankaccountId = bankaccounts.value.find(i => i.iban === account.iban).id
|
||||||
|
|
||||||
|
const res = await useEntities("bankaccounts").update(bankaccountId, {accountId: account.id, expired: false})
|
||||||
|
|
||||||
|
if(!res) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
toast.add({title: "Es gab einen Fehler bei aktualisieren des Accounts", color:"rose"})
|
toast.add({title: "Es gab einen Fehler bei aktualisieren des Accounts", color:"rose"})
|
||||||
} else if(data) {
|
} else {
|
||||||
toast.add({title: "Account erfolgreich aktualisiert"})
|
toast.add({title: "Account erfolgreich aktualisiert"})
|
||||||
setupPage()
|
setupPage()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user