Added Salutation and Title to Customer and Contact

Added Vars to GenerateContext for Salutation and title
This commit is contained in:
2025-05-18 19:09:32 +02:00
parent a0ffdce1bb
commit 55038d2bcb
2 changed files with 74 additions and 8 deletions

View File

@@ -184,16 +184,68 @@ export const useDataStore = defineStore('data', () => {
disabledFunction: function (item) {
return !item.isCompany
},
},{
key: "salutation",
label: "Anrede",
inputType: "text",
inputChangeFunction: function (row) {
row.name = ""
if(row.salutation) {
row.name += `${row.salutation}`
}
if(row.title) {
row.name += ` ${row.title}`
}
if(row.firstname) {
row.name += ` ${row.firstname}`
}
if(row.lastname) {
row.name += ` ${row.lastname}`
}
},
disabledFunction: function (item) {
return item.isCompany
},
},{
key: "title",
label: "Titel",
inputType: "text",
inputChangeFunction: function (row) {
row.name = ""
if(row.salutation) {
row.name += `${row.salutation}`
}
if(row.title) {
row.name += ` ${row.title}`
}
if(row.firstname) {
row.name += ` ${row.firstname}`
}
if(row.lastname) {
row.name += ` ${row.lastname}`
}
},
disabledFunction: function (item) {
return item.isCompany
},
},{
key: "firstname",
label: "Vorname",//TODO: Add Conditional Rendering to Datatypes
title: true,
inputType: "text",
inputChangeFunction: function (row) {
if(row.firstname && row.lastname) {
row.name = `${row.firstname} ${row.lastname}`
} else {
row.name = row.firstname
row.name = ""
if(row.salutation) {
row.name += `${row.salutation}`
}
if(row.title) {
row.name += ` ${row.title}`
}
if(row.firstname) {
row.name += ` ${row.firstname}`
}
if(row.lastname) {
row.name += ` ${row.lastname}`
}
},
disabledFunction: function (item) {
@@ -205,10 +257,18 @@ export const useDataStore = defineStore('data', () => {
title: true,
inputType: "text",
inputChangeFunction: function (row) {
if(row.firstname && row.lastname) {
row.name = `${row.firstname} ${row.lastname}`
} else {
row.name = row.lastname
row.name = ""
if(row.salutation) {
row.name += `${row.salutation}`
}
if(row.title) {
row.name += ` ${row.title}`
}
if(row.firstname) {
row.name += ` ${row.firstname}`
}
if(row.lastname) {
row.name += ` ${row.lastname}`
}
},
disabledFunction: function (item) {
@@ -341,6 +401,10 @@ export const useDataStore = defineStore('data', () => {
key: "salutation",
label: "Anrede",
inputType: "text",
},{
key: "title",
label: "Titel",
inputType: "text",
},{
key: "firstName",
label: "Vorname",