Tidying in Document Display
This commit is contained in:
@@ -51,50 +51,11 @@ const updateDocument = async () => {
|
|||||||
console.log(error)
|
console.log(error)
|
||||||
} else {
|
} else {
|
||||||
toast.add({title: "Dokument aktualisiert"})
|
toast.add({title: "Dokument aktualisiert"})
|
||||||
dataStore.fetchDocuments()
|
|
||||||
//openShowModal.value = false
|
//openShowModal.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const createVendorInvoice = async () => {
|
|
||||||
const {data:vendorInvoiceData,error:vendorInvoiceError} = await supabase
|
|
||||||
.from("incominginvoices")
|
|
||||||
.insert([{
|
|
||||||
document: documentData.id,
|
|
||||||
tenant: profileStore.currentTenant
|
|
||||||
}])
|
|
||||||
.select()
|
|
||||||
if(vendorInvoiceError) {
|
|
||||||
console.log(vendorInvoiceError)
|
|
||||||
} else if(vendorInvoiceData) {
|
|
||||||
|
|
||||||
const {data:documentUpdateData,error:documentError} = await supabase
|
|
||||||
.from("documents")
|
|
||||||
.update({
|
|
||||||
vendorInvoice: vendorInvoiceData[0].id
|
|
||||||
})
|
|
||||||
.eq('id',documentData.id)
|
|
||||||
.select()
|
|
||||||
|
|
||||||
if(documentError) {
|
|
||||||
console.log(documentError)
|
|
||||||
} else {
|
|
||||||
toast.add({title: "Dokument aktualisiert"})
|
|
||||||
dataStore.fetchDocuments()
|
|
||||||
openShowModal.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dataStore.fetchIncomingInvoices()
|
|
||||||
await router.push("/receipts")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const archiveDocument = () => {
|
const archiveDocument = () => {
|
||||||
documentData.tags.push("Archiviert")
|
documentData.tags.push("Archiviert")
|
||||||
updateDocument()
|
updateDocument()
|
||||||
@@ -238,18 +199,7 @@ const updateDocumentAssignment = async () => {
|
|||||||
>
|
>
|
||||||
Öffnen
|
Öffnen
|
||||||
</UButton>
|
</UButton>
|
||||||
<!-- <UButton
|
|
||||||
v-if="documentData.tags.includes('Eingangsrechnung')"
|
|
||||||
@click="createVendorInvoice"
|
|
||||||
>
|
|
||||||
Eingangsrechnung erstellen
|
|
||||||
</UButton>-->
|
|
||||||
</UButtonGroup>
|
</UButtonGroup>
|
||||||
<!-- <br>
|
|
||||||
<a
|
|
||||||
:href="documentData.url"
|
|
||||||
target="_blank"
|
|
||||||
>In neuen Tab anzeigen</a>-->
|
|
||||||
|
|
||||||
<UFormGroup
|
<UFormGroup
|
||||||
label="Tags ändern:"
|
label="Tags ändern:"
|
||||||
|
|||||||
Reference in New Issue
Block a user