Added Button for DeliveryNote Invoicing

This commit is contained in:
2024-11-21 21:56:27 +01:00
parent 5817931099
commit 5928c34b03

View File

@@ -109,7 +109,7 @@ const setupPage = async() => {
projecttypes.value = await useSupabaseSelect("projecttypes", "*", "id")
if(mode.value === "show" ){
itemInfo.value = await useSupabaseSelectSingle("projects",route.params.id,"*, customer(*), plant(*)")
itemInfo.value = await useSupabaseSelectSingle("projects",route.params.id,"*, customer(*), plant(*), createddocuments(*)")
} else if (mode.value === "edit") {
itemInfo.value = await useSupabaseSelectSingle("projects",route.params.id,"*")
}
@@ -232,6 +232,10 @@ const renderedPhases = computed(() => {
}
})
const invoiceDeliveryNotes = () => {
router.push(`/createDocument/edit?type=invoices&linkedDocuments=[${itemInfo.value.createddocuments.filter(i => i.type === "deliveryNotes").map(i => i.id)}]`)
}
</script>
<template>
@@ -422,10 +426,16 @@ const renderedPhases = computed(() => {
>
+ Dokument
</UButton>
<UButton
@click="invoiceDeliveryNotes"
>
Lieferscheine abrechnen
</UButton>
</Toolbar>
<UTable
:rows="dataStore.getCreatedDocumentsByProject(itemInfo.id)"
:rows="itemInfo.createddocuments"
:columns="[
{
label: 'Typ',