Fixed No Category Error
This commit is contained in:
@@ -152,6 +152,7 @@ const findIncomingInvoiceErrors = computed(() => {
|
|||||||
|
|
||||||
itemInfo.value.accounts.forEach(account => {
|
itemInfo.value.accounts.forEach(account => {
|
||||||
if(account.account === null) errors.push({message: "Es ist keine Kategorie ausgewählt", type: "breaking"})
|
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.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.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"})
|
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']"
|
:search-attributes="['label']"
|
||||||
searchable-placeholder="Suche..."
|
searchable-placeholder="Suche..."
|
||||||
v-model="item.account"
|
v-model="item.account"
|
||||||
:color="!item.account ? 'rose' : 'primary'"
|
:color="(item.account && accounts.find(i => i.id === item.account)) ? 'primary' : 'rose'"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
{{accounts.find(account => account.id === item.account) ? accounts.find(account => account.id === item.account).label : "Keine Kategorie ausgewählt" }}
|
{{accounts.find(account => account.id === item.account) ? accounts.find(account => account.id === item.account).label : "Keine Kategorie ausgewählt" }}
|
||||||
|
|||||||
Reference in New Issue
Block a user