Fixed No Category Error

This commit is contained in:
2025-11-10 13:57:45 +01:00
parent d6dd0a1602
commit aaf61760a3

View File

@@ -152,6 +152,7 @@ const findIncomingInvoiceErrors = computed(() => {
itemInfo.value.accounts.forEach(account => {
if(account.account === null) errors.push({message: "Es ist keine Kategorie ausgewählt", type: "breaking"})
if(!accounts.value.find(i => i.id === account.account)) errors.push({message: "Es ist keine Kategorie ausgewählt", type: "breaking"})
if(account.amountNet === null) errors.push({message: "Es ist kein Nettobetrag angegeben", type: "breaking"})
if(account.taxType === null) errors.push({message: "Es ist kein Steuertyp ausgewählt", type: "breaking"})
if(account.costCentre === null) errors.push({message: "Es ist keine Kostenstelle ausgewählt", type: "info"})
@@ -379,7 +380,7 @@ const findIncomingInvoiceErrors = computed(() => {
:search-attributes="['label']"
searchable-placeholder="Suche..."
v-model="item.account"
:color="!item.account ? 'rose' : 'primary'"
:color="(item.account && accounts.find(i => i.id === item.account)) ? 'primary' : 'rose'"
>
<template #label>
{{accounts.find(account => account.id === item.account) ? accounts.find(account => account.id === item.account).label : "Keine Kategorie ausgewählt" }}