diff --git a/components/EntityShow.vue b/components/EntityShow.vue
index 8e93082..5d7d55c 100644
--- a/components/EntityShow.vue
+++ b/components/EntityShow.vue
@@ -17,7 +17,7 @@ const {type} = props
defineShortcuts({
'backspace': () => {
- router.push(`/${type}`)
+ router.push(`/standardEntity/${type}`)
},
'arrowleft': () => {
if(openTab.value > 0){
diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue
index 3032b07..1a5cd39 100644
--- a/pages/createDocument/edit/[[id]].vue
+++ b/pages/createDocument/edit/[[id]].vue
@@ -86,6 +86,7 @@ const setupPage = async () => {
products.value = (await useSupabaseSelect("products","*"))
productcategories.value = (await useSupabaseSelect("productcategories","*"))
customers.value = (await useSupabaseSelect("customers","*","customerNumber"))
+ console.log(customers.value)
contacts.value = (await useSupabaseSelect("contacts","*"))
texttemplates.value = (await useSupabaseSelect("texttemplates","*"))
if(productcategories.value.length > 0) selectedProductcategorie.value = productcategories.value[0].id
@@ -229,7 +230,8 @@ const setDocumentTypeConfig = (withTexts = false) => {
const setCustomerData = () => {
- let customer = customers.find(i => i.id === itemInfo.value.customer)
+ let customer = customers.value.find(i => i.id === itemInfo.value.customer)
+ console.log(customer)
itemInfo.value.contact = null
if(customer) {
itemInfo.value.address.street = customer.infoData.street
@@ -1008,7 +1010,7 @@ const setRowData = (row) => {
searchable
searchable-placeholder="Suche..."
v-model="itemInfo.customer"
- @input="setCustomerData"
+ @change="setCustomerData"
class="flex-auto mr-2"
>
{
variant="outline"
class="w-full"
>
- {{itemInfo.customer ? customers.find(i => i.id === iteminfo.customer).name : "Kein Kunde ausgewählt"}}
+ {{itemInfo.customer ? customers.find(i => i.id === itemInfo.customer).name : "Kein Kunde ausgewählt"}}
@@ -1042,7 +1044,7 @@ const setRowData = (row) => {
Kundennr: {{customers.find(i => i.id === itemInfo.customer).customerNumber}}
Typ: {{customers.find(i => i.id === itemInfo.customer).isCompany ? 'Firma' : 'Privat'}}
- Notizen: {{customers.find(i => i.id === row.customer).notes}}
+ Notizen: {{customers.find(i => i.id === itemInfo.customer).notes}}