+
+
+
+
+
+
+
+
+
+
+
+ {
+ await supabase.auth.signOut()
+ await dataStore.clearStore()
+ await router.push('/login')
+
+ }"
+ >
+ Ausloggen
+
+
+
+
+
diff --git a/spaces/pages/vehicles/[mode]/[[id]].vue b/spaces/pages/vehicles/[mode]/[[id]].vue
index d4a1891..98c7791 100644
--- a/spaces/pages/vehicles/[mode]/[[id]].vue
+++ b/spaces/pages/vehicles/[mode]/[[id]].vue
@@ -19,7 +19,6 @@ let currentItem = ref(null)
//Working
const mode = ref(route.params.mode || "show")
const itemInfo = ref({
- id: null,
name: "",
licensePlate: "",
type: "",
diff --git a/spaces/stores/data.js b/spaces/stores/data.js
index 094cc44..a92947d 100644
--- a/spaces/stores/data.js
+++ b/spaces/stores/data.js
@@ -84,7 +84,7 @@ export const useDataStore = defineStore('data', () => {
label: "Dokumente",
labelSingle: "Dokument"
},
- incomingInvoices: {
+ incominginvoices: {
label: "Eingangsrechnungen",
labelSingle: "Eingangsrechnung"
},
@@ -146,7 +146,7 @@ export const useDataStore = defineStore('data', () => {
const contacts = ref([])
const vehicles = ref([])
const vendors = ref([])
- const incomingInvoices = ref([])
+ const incominginvoices = ref([])
const bankAccounts = ref([])
const bankStatements = ref([])
const historyItems = ref([])
@@ -303,7 +303,7 @@ export const useDataStore = defineStore('data', () => {
contacts.value= []
vehicles.value= []
vendors.value= []
- incomingInvoices.value= []
+ incominginvoices.value= []
bankAccounts.value= []
bankStatements.value= []
historyItems.value = []
@@ -421,6 +421,7 @@ export const useDataStore = defineStore('data', () => {
const uploadFiles = async (formData, files, upsert) => {
console.log(files)
+ console.log(formData)
let documentsToInsert = []
const uploadSingleFile = async (file) => {
@@ -428,7 +429,7 @@ export const useDataStore = defineStore('data', () => {
const {data, error} = await supabase
.storage
.from("files")
- .upload(`${currentTenant.value}/${file.name}`, file, {upsert})
+ .upload(`${currentTenant.value}/${file.name}`, file, {upsert: upsert})
if (error) {
console.log(error)
@@ -450,6 +451,8 @@ export const useDataStore = defineStore('data', () => {
documentsToInsert.push({...formData, path: returnPath})
}
+
+ console.log(data)
}
//uploadInProgress.value = true
@@ -548,7 +551,7 @@ export const useDataStore = defineStore('data', () => {
vendors.value = (await supabase.from("vendors").select().eq('tenant', currentTenant.value).order("vendorNumber", {ascending:true})).data
}
async function fetchIncomingInvoices () {
- incomingInvoices.value = (await supabase.from("incominginvoices").select().eq('tenant', currentTenant.value)).data
+ incominginvoices.value = (await supabase.from("incominginvoices").select().eq('tenant', currentTenant.value)).data
}
async function fetchNumberRanges () {
numberRanges.value = (await supabase.from("numberranges").select().eq('tenant', currentTenant.value)).data
@@ -728,7 +731,7 @@ export const useDataStore = defineStore('data', () => {
})
const getIncomingInvoicesByVehicleId = computed(() => (vehicleId) => {
- return incomingInvoices.value.filter(i => i.accounts.find(a => a.costCentre === vehicleId))
+ return incominginvoices.value.filter(i => i.accounts.find(a => a.costCentre === vehicleId))
})
const getMovementsBySpaceId = computed(() => (spaceId) => {
@@ -917,7 +920,7 @@ export const useDataStore = defineStore('data', () => {
})
const getIncomingInvoiceById = computed(() => (itemId) => {
- return incomingInvoices.value.find(item => item.id === itemId)
+ return incominginvoices.value.find(item => item.id === itemId)
})
const getContractById = computed(() => (itemId) => {
@@ -1020,7 +1023,7 @@ export const useDataStore = defineStore('data', () => {
contacts,
vehicles,
vendors,
- incomingInvoices,
+ incominginvoices,
bankAccounts,
bankStatements,
historyItems,