Eingangsbelege ohne Bankzuweisung archivieren
This commit is contained in:
@@ -150,6 +150,17 @@ const bankBookingDateLabel = computed(() => {
|
||||
|
||||
return bankBookingDates.value.map(formatDate).join(", ")
|
||||
})
|
||||
const hasActiveBankAssignment = computed(() => (itemInfo.value.statementallocations || []).some((allocation) => {
|
||||
if (allocation?.archived) return false
|
||||
|
||||
return Boolean(allocation?.bankstatement || allocation?.bs_id)
|
||||
}))
|
||||
const canArchiveIncomingInvoice = computed(() => {
|
||||
if (itemInfo.value.archived) return false
|
||||
if (mode.value !== "show") return true
|
||||
|
||||
return itemInfo.value.state === "Gebucht" && !hasActiveBankAssignment.value
|
||||
})
|
||||
const vendorName = computed(() => vendors.value.find((vendor) => vendor.id === itemInfo.value.vendor)?.name || "-")
|
||||
const eInvoiceValidation = computed(() => itemInfo.value.eInvoiceValidation || null)
|
||||
const eInvoiceSourceLabel = computed(() => {
|
||||
@@ -322,7 +333,7 @@ const hasBlockingIncomingInvoiceErrors = computed(() => blockingIncomingInvoiceE
|
||||
</template>
|
||||
<template #right>
|
||||
<ArchiveButton
|
||||
v-if="mode !== 'show'"
|
||||
v-if="canArchiveIncomingInvoice"
|
||||
color="error"
|
||||
variant="outline"
|
||||
type="incominginvoices"
|
||||
|
||||
Reference in New Issue
Block a user