2. Zwischenstand
This commit is contained in:
@@ -55,82 +55,82 @@
|
||||
{{ getRowsForTab(item.key).length }}
|
||||
</UBadge>
|
||||
</template>
|
||||
<template #item="{item}">
|
||||
<template #content="{item}">
|
||||
<div style="height: 80vh; overflow-y: scroll">
|
||||
<UTable
|
||||
:columns="normalizeTableColumns(getColumnsForTab(item.key))"
|
||||
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Belege anzuzeigen' }"
|
||||
:empty="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Belege anzuzeigen' }"
|
||||
:data="getRowsForTab(item.key)"
|
||||
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
|
||||
class="w-full"
|
||||
@select="selectItem"
|
||||
:on-select="selectItem"
|
||||
>
|
||||
<template #type-data="{row}">
|
||||
<span v-if="row.type === 'cancellationInvoices'" class="text-cyan-500">{{
|
||||
dataStore.documentTypesForCreation[row.type].labelSingle
|
||||
}} für {{ filteredRows.find(i => row.createddocument?.id === i.id)?.documentNumber }}</span>
|
||||
<span v-else>{{ dataStore.documentTypesForCreation[row.type].labelSingle }}</span>
|
||||
<template #type-cell="{row}">
|
||||
<span v-if="row.original.type === 'cancellationInvoices'" class="text-cyan-500">{{
|
||||
dataStore.documentTypesForCreation[row.original.type].labelSingle
|
||||
}} für {{ filteredRows.find(i => row.original.createddocument?.id === i.id)?.documentNumber }}</span>
|
||||
<span v-else>{{ dataStore.documentTypesForCreation[row.original.type].labelSingle }}</span>
|
||||
</template>
|
||||
|
||||
<template #state-data="{row}">
|
||||
<span v-if="row.state === 'Entwurf'" class="text-rose-500">{{ row.state }}</span>
|
||||
<template #state-cell="{row}">
|
||||
<span v-if="row.original.state === 'Entwurf'" class="text-rose-500">{{ row.original.state }}</span>
|
||||
<span
|
||||
v-if="row.state === 'Gebucht' && !hasCancellationInvoice(row)"
|
||||
v-if="row.original.state === 'Gebucht' && !hasCancellationInvoice(row.original)"
|
||||
class="text-primary-500"
|
||||
>
|
||||
{{ row.state }}
|
||||
{{ row.original.state }}
|
||||
</span>
|
||||
<span
|
||||
v-else-if="row.state === 'Gebucht' && hasCancellationInvoice(row) && ['invoices','advanceInvoices'].includes(row.type)"
|
||||
v-else-if="row.original.state === 'Gebucht' && hasCancellationInvoice(row.original) && ['invoices','advanceInvoices'].includes(row.original.type)"
|
||||
class="text-cyan-500"
|
||||
>
|
||||
Storniert mit {{ getCancellationInvoice(row)?.documentNumber }}
|
||||
Storniert mit {{ getCancellationInvoice(row.original)?.documentNumber }}
|
||||
</span>
|
||||
<span v-else-if="row.state === 'Gebucht'" class="text-primary-500">{{ row.state }}</span>
|
||||
<span v-else-if="row.original.state === 'Gebucht'" class="text-primary-500">{{ row.original.state }}</span>
|
||||
</template>
|
||||
|
||||
<template #partner-data="{row}">
|
||||
<span v-if="row.customer && row.customer.name.length < 21">{{ row.customer ? row.customer.name : "" }}</span>
|
||||
<UTooltip v-else-if="row.customer && row.customer.name.length > 20" :text="row.customer.name">
|
||||
{{ row.customer.name.substring(0, 20) }}...
|
||||
<template #partner-cell="{row}">
|
||||
<span v-if="row.original.customer && row.original.customer.name.length < 21">{{ row.original.customer ? row.original.customer.name : "" }}</span>
|
||||
<UTooltip v-else-if="row.original.customer && row.original.customer.name.length > 20" :text="row.original.customer.name">
|
||||
{{ row.original.customer.name.substring(0, 20) }}...
|
||||
</UTooltip>
|
||||
</template>
|
||||
|
||||
<template #reference-data="{row}">
|
||||
<span v-if="row === filteredRows[selectedItem]" class="text-primary-500 font-bold">{{ row.documentNumber }}</span>
|
||||
<span v-else>{{ row.documentNumber }}</span>
|
||||
<template #reference-cell="{row}">
|
||||
<span v-if="row.original === filteredRows[selectedItem]" class="text-primary-500 font-bold">{{ row.original.documentNumber }}</span>
|
||||
<span v-else>{{ row.original.documentNumber }}</span>
|
||||
</template>
|
||||
|
||||
<template #date-data="{row}">
|
||||
<span v-if="row.date">{{ row.date ? dayjs(row.date).format("DD.MM.YY") : '' }}</span>
|
||||
<span v-if="row.documentDate">{{ row.documentDate ? dayjs(row.documentDate).format("DD.MM.YY") : '' }}</span>
|
||||
<template #date-cell="{row}">
|
||||
<span v-if="row.original.date">{{ row.original.date ? dayjs(row.original.date).format("DD.MM.YY") : '' }}</span>
|
||||
<span v-if="row.original.documentDate">{{ row.original.documentDate ? dayjs(row.original.documentDate).format("DD.MM.YY") : '' }}</span>
|
||||
</template>
|
||||
|
||||
<template #dueDate-data="{row}">
|
||||
<template #dueDate-cell="{row}">
|
||||
<span
|
||||
v-if="row.state === 'Gebucht' && row.paymentDays && ['invoices','advanceInvoices'].includes(row.type) && !hasCancellationInvoice(row)"
|
||||
:class="dayjs(row.documentDate).add(row.paymentDays,'day').diff(dayjs()) <= 0 && !isPaid(row) ? ['text-rose-500'] : '' "
|
||||
v-if="row.original.state === 'Gebucht' && row.original.paymentDays && ['invoices','advanceInvoices'].includes(row.original.type) && !hasCancellationInvoice(row.original)"
|
||||
:class="dayjs(row.original.documentDate).add(row.original.paymentDays,'day').diff(dayjs()) <= 0 && !isPaid(row.original) ? ['text-rose-500'] : '' "
|
||||
>
|
||||
{{ row.documentDate ? dayjs(row.documentDate).add(row.paymentDays, 'day').format("DD.MM.YY") : '' }}
|
||||
{{ row.original.documentDate ? dayjs(row.original.documentDate).add(row.original.paymentDays, 'day').format("DD.MM.YY") : '' }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #paid-data="{row}">
|
||||
<template #paid-cell="{row}">
|
||||
<div
|
||||
v-if="(row.type === 'invoices' ||row.type === 'advanceInvoices') && row.state === 'Gebucht' && !hasCancellationInvoice(row)">
|
||||
<span v-if="useSum().getIsPaid(row,items)" class="text-primary-500">Bezahlt</span>
|
||||
v-if="(row.original.type === 'invoices' ||row.original.type === 'advanceInvoices') && row.original.state === 'Gebucht' && !hasCancellationInvoice(row.original)">
|
||||
<span v-if="useSum().getIsPaid(row.original,items)" class="text-primary-500">Bezahlt</span>
|
||||
<span v-else class="text-rose-600">Offen</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #amount-data="{row}">
|
||||
<span v-if="row.type !== 'deliveryNotes'">{{ displayCurrency(useSum().getCreatedDocumentSum(row, items)) }}</span>
|
||||
<template #amount-cell="{row}">
|
||||
<span v-if="row.original.type !== 'deliveryNotes'">{{ displayCurrency(useSum().getCreatedDocumentSum(row.original, items)) }}</span>
|
||||
</template>
|
||||
|
||||
<template #amountOpen-data="{row}">
|
||||
<template #amountOpen-cell="{row}">
|
||||
<span
|
||||
v-if="!['deliveryNotes','cancellationInvoices','quotes','confirmationOrders'].includes(row.type) && row.state !== 'Entwurf' && !hasCancellationInvoice(row) && !useSum().getIsPaid(row,items) ">
|
||||
{{ displayCurrency(useSum().getCreatedDocumentOpenAmount(row, items)) }}
|
||||
v-if="!['deliveryNotes','cancellationInvoices','quotes','confirmationOrders'].includes(row.original.type) && row.original.state !== 'Entwurf' && !hasCancellationInvoice(row.original) && !useSum().getIsPaid(row.original,items) ">
|
||||
{{ displayCurrency(useSum().getCreatedDocumentOpenAmount(row.original, items)) }}
|
||||
</span>
|
||||
</template>
|
||||
</UTable>
|
||||
|
||||
Reference in New Issue
Block a user