Fixed Texttemplates and Title Import from Copy

This commit is contained in:
2025-05-13 15:43:59 +02:00
parent 241a912f08
commit 557d0eff2f
2 changed files with 11 additions and 7 deletions

View File

@@ -8,13 +8,17 @@ const props = defineProps({
type: String, type: String,
required: true required: true
}, },
type: {
type: String,
required: true
},
}) })
const emit = defineEmits(["updateNeeded","returnData"]) const emit = defineEmits(["updateNeeded","returnData"])
const documentTypeToUse = ref("invoices") const documentTypeToUse = ref(props.type)
const optionsToImport = ref({ const optionsToImport = ref({
taxType: true, taxType: true,
customer: true, customer: true,
@@ -29,11 +33,10 @@ const optionsToImport = ref({
contactPerson: true, contactPerson: true,
plant: true, plant: true,
project:true, project:true,
title: true,
description: true, description: true,
startText: true, startText: false,
rows: true, rows: true,
endText: true, endText: false,
}) })
const mappings = ref({ const mappings = ref({
@@ -50,7 +53,6 @@ const mappings = ref({
contactPerson: "Ansprechpartner Mitarbeiter", contactPerson: "Ansprechpartner Mitarbeiter",
plant: "Objekt", plant: "Objekt",
project: "Projekt", project: "Projekt",
title: "Titel",
description: "Beschreibung", description: "Beschreibung",
startText: "Einleitung", startText: "Einleitung",
rows: "Positionen", rows: "Positionen",
@@ -84,9 +86,10 @@ const startImport = () => {
</USelectMenu> </USelectMenu>
</UFormGroup> </UFormGroup>
<UCheckbox <UCheckbox
v-for="key in Object.keys(optionsToImport)" v-for="key in Object.keys(optionsToImport).filter(i => documentTypeToUse !== props.type ? !['startText','endText'].includes(i) : true)"
v-model="optionsToImport[key]" v-model="optionsToImport[key]"
:label="mappings[key]"/> :label="mappings[key]"
/>
<template #footer> <template #footer>

View File

@@ -74,6 +74,7 @@ const openEmail = () => {
icon="i-heroicons-arrow-right-end-on-rectangle" icon="i-heroicons-arrow-right-end-on-rectangle"
@click="modal.open(CopyCreatedDocumentModal, { @click="modal.open(CopyCreatedDocumentModal, {
id: itemInfo.id, id: itemInfo.id,
type: itemInfo.type
})" })"
variant="outline" variant="outline"
> >