Changed some in EntityShowSubCreatedDocuments.vue

This commit is contained in:
2025-06-26 11:36:54 +02:00
parent 583ca15dcc
commit e98e1dc634

View File

@@ -68,27 +68,27 @@ setup()
const templateColumns = [
{
key: "reference",
label: "Referenz",
sortable: true
label: "Referenz"
},
{
key: 'type',
label: "Typ",
sortable: true
label: "Typ"
},{
key: 'state',
label: "Status",
sortable: true
label: "Status"
},{
key: 'paid',
label: "Bezahlt"
},
{
key: "date",
label: "Datum",
sortable: true
label: "Datum"
},
{
key: "dueDate",
label: "Fällig",
sortable: true
label: "Fällig"
}
]
const selectedColumns = ref(tempStore.columns["createddocuments"] ? tempStore.columns["createddocuments"] : templateColumns)
@@ -119,7 +119,14 @@ const getAvailableQueryStringData = (keys) => {
}
const invoiceDeliveryNotes = () => {
router.push(`/createDocument/edit?type=invoices&linkedDocuments=[${props.item.createddocuments.filter(i => i.type === "deliveryNotes").map(i => i.id)}]`)
router.push(`/createDocument/edit?type=invoices&loadMode=deliveryNotes&linkedDocuments=[${props.item.createddocuments.filter(i => i.type === "deliveryNotes").map(i => i.id)}]`)
}
const showFinalInvoiceConfig = ref(false)
const referenceDocument = ref(null)
const advanceInvoicesToAdd = ref([])
const invoiceAdvanceInvoices = () => {
router.push(`/createDocument/edit?type=invoices&loadMode=finalInvoice&linkedDocuments=[${[referenceDocument.value, ... advanceInvoicesToAdd.value]}]`)
}
const selectItem = (item) => {
@@ -166,6 +173,59 @@ const selectItem = (item) => {
>
+ Abschlagsrechnung
</UButton>
<UButton
@click="showFinalInvoiceConfig = true"
v-if="props.topLevelType === 'projects'"
:disabled="!props.item.createddocuments.filter(i => !i.archived && i.type === 'advanceInvoices').length > 0"
>
+ Schlussrechnung
</UButton>
<UModal
prevent-close
v-model="showFinalInvoiceConfig"
>
<UCard>
<template #header>
<div class="flex items-center justify-between">
<h3 class="text-base font-semibold leading-6 text-gray-900 dark:text-white">
Schlussrechnung konfigurieren
</h3>
<UButton color="gray" variant="ghost" icon="i-heroicons-x-mark-20-solid" class="-my-1" @click="isOpen = false" />
</div>
</template>
<UFormGroup
label="Rechnungsvorlage"
>
<USelectMenu
:options="props.item.createddocuments.filter(i => ['confirmationOrders','quotes'].includes(i.type))"
value-attribute="id"
option-attribute="documentNumber"
v-model="referenceDocument"
/>
</UFormGroup>
<UFormGroup
label="Abschlagsrechnungen"
>
<USelectMenu
:options="props.item.createddocuments.filter(i => ['advanceInvoices'].includes(i.type))"
multiple
value-attribute="id"
option-attribute="documentNumber"
v-model="advanceInvoicesToAdd"
/>
</UFormGroup>
<template #footer>
<UButton
@click="invoiceAdvanceInvoices"
>
Weiter
</UButton>
</template>
</UCard>
</UModal>
<UButton
@click="router.push(`/createDocument/edit/?${getAvailableQueryStringData({type: 'invoices'})}`)"
>
@@ -219,6 +279,12 @@ const selectItem = (item) => {
{{row.state}}
</span>
</template>
<template #paid-data="{row}">
<div v-if="(row.type === 'invoices' ||row.type === 'advanceInvoices') && row.state === 'Gebucht'">
<span v-if="useSum().getIsPaid(row)" class="text-primary-500">Bezahlt</span>
<span v-else class="text-rose-600">Offen</span>
</div>
</template>
<template #reference-data="{row}">
<span v-if="row === props.item.createddocuments[selectedItem]" class="text-primary-500 font-bold">{{row.documentNumber}}</span>
<span v-else>{{row.documentNumber}}</span>