Added Zahlungsziel

This commit is contained in:
2024-03-13 08:37:37 +01:00
parent 85dd60c197
commit d1419fdad1

View File

@@ -32,6 +32,7 @@ const itemInfo = ref({
deliveryDate: dayjs(), deliveryDate: dayjs(),
deliveryDateType: "Lieferdatum", deliveryDateType: "Lieferdatum",
dateOfPerformance: null, dateOfPerformance: null,
paymentDays: 7,
createdBy: user.value.id, createdBy: user.value.id,
title: null, title: null,
description: null, description: null,
@@ -287,7 +288,7 @@ const getDocumentData = () => {
}, },
title: itemInfo.value.title, title: itemInfo.value.title,
description: itemInfo.value.description, description: itemInfo.value.description,
endText: templateEndText({zahlungsziel_in_tagen: 14}), endText: templateEndText({zahlungsziel_in_tagen: itemInfo.value.paymentDays}),
startText: templateStartText({vorname: contactData.firstName, nachname: contactData.lastName}), startText: templateStartText({vorname: contactData.firstName, nachname: contactData.lastName}),
rows: rows, rows: rows,
total: documentTotal.value total: documentTotal.value
@@ -455,53 +456,73 @@ setupPage()
<UFormGroup <UFormGroup
label="Kunde:" label="Kunde:"
> >
<USelectMenu <InputGroup>
:options="dataStore.customers" <USelectMenu
option-attribute="name" :options="dataStore.customers"
value-attribute="id" option-attribute="name"
:search-attributes="['name']" value-attribute="id"
searchable :search-attributes="['name']"
searchable-placeholder="Suche..." searchable
v-model="itemInfo.customer" searchable-placeholder="Suche..."
@change="setCustomerData" v-model="itemInfo.customer"
> @change="setCustomerData"
<UButton class="flex-auto"
:color="itemInfo.customer ? 'primary' : 'rose'" >
variant="outline" <UButton
class="flex-1 justify-between"> :color="itemInfo.customer ? 'primary' : 'rose'"
{{dataStore.getCustomerById(itemInfo.customer) ? dataStore.getCustomerById(itemInfo.customer).name : "Kein Kunde ausgewählt"}} variant="outline"
class="flex-1 justify-between">
{{dataStore.getCustomerById(itemInfo.customer) ? dataStore.getCustomerById(itemInfo.customer).name : "Kein Kunde ausgewählt"}}
<UIcon name="i-heroicons-chevron-right-20-solid" class="w-5 h-5 transition-transform text-gray-400 dark:text-gray-500" :class="['transform rotate-90']" />
</UButton>
<!-- <template #label>
{{dataStore.getCustomerById(itemInfo.customer) ? dataStore.getCustomerById(itemInfo.customer).name : "Kein Kunde ausgewählt"}}
</template>-->
</USelectMenu>
<UButton
variant="outline"
v-if="itemInfo.customer"
icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/customers/show/${itemInfo.customer}`)"
>Kunde</UButton>
</InputGroup>
<UIcon name="i-heroicons-chevron-right-20-solid" class="w-5 h-5 transition-transform text-gray-400 dark:text-gray-500" :class="['transform rotate-90']" />
</UButton>
<!-- <template #label>
{{dataStore.getCustomerById(itemInfo.customer) ? dataStore.getCustomerById(itemInfo.customer).name : "Kein Kunde ausgewählt"}}
</template>-->
</USelectMenu>
</UFormGroup> </UFormGroup>
<UFormGroup <UFormGroup
label="Ansprechpartner:" label="Ansprechpartner:"
> >
<USelectMenu <InputGroup>
:options="dataStore.getContactsByCustomerId(itemInfo.customer)" <USelectMenu
option-attribute="fullName" :options="dataStore.getContactsByCustomerId(itemInfo.customer)"
value-attribute="id" option-attribute="fullName"
:search-attributes="['name']" value-attribute="id"
searchable :search-attributes="['name']"
searchable-placeholder="Suche..." searchable
v-model="itemInfo.contact" searchable-placeholder="Suche..."
> v-model="itemInfo.contact"
<UButton class="flex-auto"
:color="itemInfo.contact ? 'primary' : 'rose'" >
variant="outline" <UButton
class="flex-1 justify-between"> :color="itemInfo.contact ? 'primary' : 'rose'"
{{dataStore.getContactById(itemInfo.contact) ? dataStore.getContactById(itemInfo.contact).fullName : "Kein Kontakt ausgewählt"}} variant="outline"
class="flex-1 justify-between">
{{dataStore.getContactById(itemInfo.contact) ? dataStore.getContactById(itemInfo.contact).fullName : "Kein Kontakt ausgewählt"}}
<UIcon name="i-heroicons-chevron-right-20-solid" class="w-5 h-5 transition-transform text-gray-400 dark:text-gray-500" :class="['transform rotate-90']" />
</UButton>
<template #label>
{{dataStore.getContactById(itemInfo.contact) ? dataStore.getContactById(itemInfo.contact).fullName : "Kein Kontakt ausgewählt"}}
</template>
</USelectMenu>
<UButton
variant="outline"
v-if="itemInfo.contact"
icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/contacts/show/${itemInfo.contact}`)"
>Kontakt</UButton>
</InputGroup>
<UIcon name="i-heroicons-chevron-right-20-solid" class="w-5 h-5 transition-transform text-gray-400 dark:text-gray-500" :class="['transform rotate-90']" />
</UButton>
<template #label>
{{dataStore.getContactById(itemInfo.contact) ? dataStore.getContactById(itemInfo.contact).fullName : "Kein Kontakt ausgewählt"}}
</template>
</USelectMenu>
</UFormGroup> </UFormGroup>
<UFormGroup <UFormGroup
@@ -544,46 +565,67 @@ setupPage()
/> />
</UFormGroup> </UFormGroup>
<InputGroup class="w-full">
<UFormGroup
label="Datum:"
>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.documentDate ? dayjs(itemInfo.documentDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/>
<UFormGroup <template #panel="{ close }">
label="Datum:" <LazyDatePicker v-model="itemInfo.documentDate" @close="close" />
> </template>
<UPopover :popper="{ placement: 'bottom-start' }"> </UPopover>
<UButton </UFormGroup>
icon="i-heroicons-calendar-days-20-solid" <UFormGroup
:label="itemInfo.documentDate ? dayjs(itemInfo.documentDate).format('DD.MM.YYYY') : 'Datum auswählen'" class="mt-3 w-80"
variant="outline" label="Lieferdatumsart:"
>
<USelectMenu
:options="['Lieferdatum'/*,'Lieferzeitraum'*/,'Leistungsdatum'/*,'Leistungszeitraum'*/,'Kein Lieferdatum anzeigen']"
v-model="itemInfo.deliveryDateType"
class="mb-2"
/> />
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.documentDate" @close="close" />
</template>
</UPopover>
</UFormGroup>
</UFormGroup>
<UFormGroup
:label="itemInfo.deliveryDateType"
>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.deliveryDate ? dayjs(itemInfo.deliveryDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/>
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.deliveryDate" @close="close" />
</template>
</UPopover>
</UFormGroup>
<UFormGroup
<UFormGroup label="Zahlungziel in Tagen:"
class="mt-3" class="flex-auto"
> >
<USelectMenu <UInput
:options="['Lieferdatum'/*,'Lieferzeitraum'*/,'Leistungsdatum'/*,'Leistungszeitraum'*/,'Kein Lieferdatum anzeigen']" type="number"
v-model="itemInfo.deliveryDateType" v-model="itemInfo.paymentDays"
class="mb-2"
/>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.deliveryDate ? dayjs(itemInfo.deliveryDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/> />
</UFormGroup>
</InputGroup>
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.deliveryDate" @close="close" />
</template>
</UPopover>
</UFormGroup>
<UFormGroup <UFormGroup
label="Ansprechpartner:" label="Ansprechpartner:"
> >