From 38c6e01d9f6f318351ec63ca5446466ce94aeaab Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Thu, 9 Jan 2025 11:50:13 +0100 Subject: [PATCH] Added Customer Ref Added Document Error in createddocuments --- pages/createDocument/edit/[[id]].vue | 9 +++++++++ stores/data.js | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index 0517e24..db076ff 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -187,6 +187,13 @@ const setupPage = async () => { if(route.query.project) { itemInfo.value.project = Number(route.query.project) + + let project = await useSupabaseSelectSingle("projects",itemInfo.value.project) + + if(!itemInfo.value.description){ + itemInfo.value.description = project.customerRef + } + } if(route.query.contact) itemInfo.value.contact = Number(route.query.contact) if(route.query.customer) { @@ -422,6 +429,7 @@ const findDocumentErrors = computed(() => { if(row.mode === "service" && !row.service) errors.push({message: `In Position ${row.pos} ist keine Leistung ausgewählt`, type: "breaking"}) if(row.mode === "title" && !row.text) errors.push({message: `In Position ${row.pos} ist kein Titel hinterlegt`, type: "breaking"}) if(row.mode === "text" && !row.text) errors.push({message: `In einer Freitext Position ist kein Titel hinterlegt`, type: "breaking"}) + if(row.mode === "free" && !row.text) errors.push({message: `In einer freien Position ist kein Titel hinterlegt`, type: "breaking"}) }) } @@ -929,6 +937,7 @@ const setRowData = (row) => { +