diff --git a/pages/incomingInvoices/[mode]/[id].vue b/pages/incomingInvoices/[mode]/[id].vue index 26a5496..319fc26 100644 --- a/pages/incomingInvoices/[mode]/[id].vue +++ b/pages/incomingInvoices/[mode]/[id].vue @@ -45,6 +45,8 @@ const setup = async () => { itemInfo.value = await useEntities("incominginvoices").selectSingle(route.params.id, "*, files(*)") await loadFile(itemInfo.value.files[itemInfo.value.files.length-1].id) + if(itemInfo.value.date && !itemInfo.value.dueDate) itemInfo.value.dueDate = itemInfo.value.date + } setup() @@ -145,7 +147,7 @@ const findIncomingInvoiceErrors = computed(() => { let errors = [] if(itemInfo.value.vendor === null) errors.push({message: "Es ist kein Lieferant ausgewählt", type: "breaking"}) - if(itemInfo.value.reference === null) errors.push({message: "Es ist keine Referenz angegeben", type: "breaking"}) + if(itemInfo.value.reference === null || itemInfo.value.reference.length === 0) errors.push({message: "Es ist keine Referenz angegeben", type: "breaking"}) if(itemInfo.value.date === null) errors.push({message: "Es ist kein Datum ausgewählt", type: "breaking"}) if(itemInfo.value.dueDate === null) errors.push({message: "Es ist kein Fälligkeitsdatum ausgewählt", type: "breaking"}) if(itemInfo.value.paymentType === null) errors.push({message: "Es ist keine Zahlart ausgewählt", type: "breaking"}) @@ -220,7 +222,6 @@ const findIncomingInvoiceErrors = computed(() => { class="mx-5 documentPreview" />