From 24e80a6a0a946762fb0ef57cc84da54b012e0d68 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Tue, 11 Nov 2025 19:36:38 +0100 Subject: [PATCH 01/12] Added Pagebreak Error --- pages/createDocument/edit/[[id]].vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index 82c3659..047fa9c 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -661,7 +661,7 @@ const findDocumentErrors = computed(() => { if (itemInfo.value.rows.length === 0) { errors.push({message: "Es sind keine Positionen angegeben", type: "breaking"}) } else { - itemInfo.value.rows.forEach(row => { + itemInfo.value.rows.forEach((row,index) => { if (itemInfo.value.type !== "quotes" && row.optional) { errors.push({ @@ -717,6 +717,10 @@ const findDocumentErrors = computed(() => { } } + if (index === itemInfo.value.rows.length - 1 && row.mode === "pagebreak") { + errors.push({message: `Die letze Position darf kein Seitenumbruch sein`, type: "breaking"}) + } + }) } From 263f389e9129cca9509144096325e95750d3af40 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Fri, 14 Nov 2025 17:33:27 +0100 Subject: [PATCH 02/12] Removed Download Button for Temporary Display --- components/PDFViewer.client.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/components/PDFViewer.client.vue b/components/PDFViewer.client.vue index 2dffbf3..1ac1946 100644 --- a/components/PDFViewer.client.vue +++ b/components/PDFViewer.client.vue @@ -168,6 +168,7 @@ watch(downloadControl, (downloadCtrl) => { variant="outline" > Date: Fri, 14 Nov 2025 17:33:41 +0100 Subject: [PATCH 03/12] Added dataUriToFile Function --- composables/useFiles.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/composables/useFiles.ts b/composables/useFiles.ts index 657824d..7323c8e 100644 --- a/composables/useFiles.ts +++ b/composables/useFiles.ts @@ -124,6 +124,19 @@ export const useFiles = () => { } + const dataURLtoFile = (dataurl:string, filename:string) => { + let arr = dataurl.split(","), + //@ts-ignore + mime = arr[0].match(/:(.*?);/)[1], + bstr = atob(arr[arr.length - 1]), + n = bstr.length, + u8arr = new Uint8Array(n); + while (n--) { + u8arr[n] = bstr.charCodeAt(n); + } + return new File([u8arr], filename, {type: mime}); + } - return {uploadFiles, selectDocuments, selectSomeDocuments, selectDocument, downloadFile} + + return {uploadFiles, selectDocuments, selectSomeDocuments, selectDocument, downloadFile, dataURLtoFile} } \ No newline at end of file From 32c71fe49b54b2b1a34a8ebb02614a18d9c01800 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Fri, 14 Nov 2025 17:34:15 +0100 Subject: [PATCH 04/12] Introduced Employee Number Added Ability to Save Bericht --- pages/staff/time/[id]/evaluate.vue | 37 +++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/pages/staff/time/[id]/evaluate.vue b/pages/staff/time/[id]/evaluate.vue index bfe6e97..e5b9c50 100644 --- a/pages/staff/time/[id]/evaluate.vue +++ b/pages/staff/time/[id]/evaluate.vue @@ -3,7 +3,7 @@ const { $dayjs } = useNuxtApp() const router = useRouter() const route = useRoute() const auth = useAuthStore() - +const toast = useToast() // 🔹 State const workingtimes = ref([]) const absencerequests = ref([]) @@ -81,10 +81,32 @@ async function generateDocument() { uri.value = await useFunctions().useCreatePDF({ full_name: profile.value.full_name, + employee_number: profile.value.employee_number ? profile.value.employee_number : "-", ...workingTimeInfo.value}, path, "timesheet") showDocument.value = true +} +const fileSaved = ref(false) +async function saveFile() { + try { + let fileData = { + auth_profile: profile.value.id, + tenant: auth.activeTenant + } + + let file = useFiles().dataURLtoFile(uri.value, `${profile.value.full_name}-${$dayjs(selectedStartDay.value).format("YYYY-MM-DD")}-${$dayjs(selectedEndDay.value).format("YYYY-MM-DD")}.pdf`) + + await useFiles().uploadFiles(fileData, [file]) + + toast.add({title:"Auswertung erfolgreich gespeichert"}) + fileSaved.value = true + } catch (error) { + toast.add({title:"Fehler beim Speichern der Auswertung", color: "rose"}) + } + + + } async function onTabChange(index: number) { @@ -157,6 +179,19 @@ changeRange() + From da074df63c8b562c37efab6a784be61c4bb59b8d Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Fri, 14 Nov 2025 17:48:15 +0100 Subject: [PATCH 05/12] Redone IncomingInvoice Show/Edit --- .../{edit => [mode]}/[id].vue | 53 +++++- pages/incomingInvoices/show/[id].vue | 163 ------------------ 2 files changed, 46 insertions(+), 170 deletions(-) rename pages/incomingInvoices/{edit => [mode]}/[id].vue (91%) delete mode 100644 pages/incomingInvoices/show/[id].vue diff --git a/pages/incomingInvoices/edit/[id].vue b/pages/incomingInvoices/[mode]/[id].vue similarity index 91% rename from pages/incomingInvoices/edit/[id].vue rename to pages/incomingInvoices/[mode]/[id].vue index dc033b3..26a5496 100644 --- a/pages/incomingInvoices/edit/[id].vue +++ b/pages/incomingInvoices/[mode]/[id].vue @@ -32,6 +32,8 @@ const costcentres = ref([]) const vendors = ref([]) const accounts = ref([]) +const mode = ref(route.params.mode) + const setup = async () => { let filetype = (await useEntities("filetags").select()).find(i=> i.incomingDocumentType === "invoices").id console.log(filetype) @@ -168,21 +170,38 @@ const findIncomingInvoiceErrors = computed(() => {