Tidying in Document Display
This commit is contained in:
@@ -51,50 +51,11 @@ const updateDocument = async () => {
|
||||
console.log(error)
|
||||
} else {
|
||||
toast.add({title: "Dokument aktualisiert"})
|
||||
dataStore.fetchDocuments()
|
||||
//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 = () => {
|
||||
documentData.tags.push("Archiviert")
|
||||
updateDocument()
|
||||
@@ -238,18 +199,7 @@ const updateDocumentAssignment = async () => {
|
||||
>
|
||||
Öffnen
|
||||
</UButton>
|
||||
<!-- <UButton
|
||||
v-if="documentData.tags.includes('Eingangsrechnung')"
|
||||
@click="createVendorInvoice"
|
||||
>
|
||||
Eingangsrechnung erstellen
|
||||
</UButton>-->
|
||||
</UButtonGroup>
|
||||
<!-- <br>
|
||||
<a
|
||||
:href="documentData.url"
|
||||
target="_blank"
|
||||
>In neuen Tab anzeigen</a>-->
|
||||
|
||||
<UFormGroup
|
||||
label="Tags ändern:"
|
||||
|
||||
Reference in New Issue
Block a user